linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-pm@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client
Date: Thu, 27 Jun 2019 20:28:17 +0200	[thread overview]
Message-ID: <20190627182817.5vrfmuzn7kanvtwu@earth.universe> (raw)
In-Reply-To: <20190608105619.593-1-wsa+renesas@sang-engineering.com>

[-- Attachment #1: Type: text/plain, Size: 5906 bytes --]

Hi,

On Sat, Jun 08, 2019 at 12:55:39PM +0200, Wolfram Sang wrote:
> While preparing a refactoring series, I noticed that some drivers use a
> complicated way of determining the adapter of a client. The easy way is
> to use the intended pointer: client->adapter
> 
> These drivers do:
> 	to_i2c_adapter(client->dev.parent);
> 
> The I2C core populates the parent pointer as:
> 	client->dev.parent = &client->adapter->dev;
> 
> Now take into consideration that
> 	to_i2c_adapter(&adapter->dev);
> 
> is a complicated way of saying 'adapter', then we can even formally
> prove that the complicated expression can be simplified by using
> client->adapter.
> 
> The conversion was done using a coccinelle script with some manual
> indentation fixes applied on top.
> 
> To avoid a brown paper bag mistake, I double checked this on a Renesas
> Salvator-XS board (R-Car M3N) and verified both expression result in the
> same pointer. Other than that, the series is only build tested.
> 
> A branch can be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/no_to_adapter
> 
> Please apply the patches to the individual subsystem trees. There are no
> dependencies.
> 
> Thanks and kind regards,
> 
>    Wolfram

Thanks, I queued the patches prefixed with "power: supply: [...]".

-- Sebastian

> Wolfram Sang (34):
>   clk: clk-cdce706: simplify getting the adapter of a client
>   gpu: drm: bridge: sii9234: simplify getting the adapter of a client
>   iio: light: bh1780: simplify getting the adapter of a client
>   leds: leds-pca955x: simplify getting the adapter of a client
>   leds: leds-tca6507: simplify getting the adapter of a client
>   media: i2c: ak881x: simplify getting the adapter of a client
>   media: i2c: mt9m001: simplify getting the adapter of a client
>   media: i2c: mt9m111: simplify getting the adapter of a client
>   media: i2c: mt9p031: simplify getting the adapter of a client
>   media: i2c: ov2640: simplify getting the adapter of a client
>   media: i2c: tw9910: simplify getting the adapter of a client
>   misc: fsa9480: simplify getting the adapter of a client
>   misc: isl29003: simplify getting the adapter of a client
>   misc: tsl2550: simplify getting the adapter of a client
>   mtd: maps: pismo: simplify getting the adapter of a client
>   power: supply: bq24190_charger: simplify getting the adapter of a client
>   power: supply: bq24257_charger: simplify getting the adapter of a client
>   power: supply: bq25890_charger: simplify getting the adapter of a client
>   power: supply: max14656_charger_detector: simplify getting the adapter
>     of a client
>   power: supply: max17040_battery: simplify getting the adapter of a client
>   power: supply: max17042_battery: simplify getting the adapter of a client
>   power: supply: rt5033_battery: simplify getting the adapter of a client
>   power: supply: rt9455_charger: simplify getting the adapter of a client
>   power: supply: sbs-manager: simplify getting the adapter of a client
>   regulator: max8952: simplify getting the adapter of a client
>   rtc: fm3130: simplify getting the adapter of a client
>   rtc: m41t80: simplify getting the adapter of a client
>   rtc: rv8803: simplify getting the adapter of a client
>   rtc: rx8010: simplify getting the adapter of a client
>   rtc: rx8025: simplify getting the adapter of a client
>   staging: media: soc_camera: imx074: simplify getting the adapter of a client
>   staging: media: soc_camera: mt9t031: simplify getting the adapter of a client
>   staging: media: soc_camera: soc_mt9v022: simplify getting the adapter
>     of a client
>   usb: typec: tcpm: fusb302: simplify getting the adapter of a client
> 
>  drivers/clk/clk-cdce706.c                        | 2 +-
>  drivers/gpu/drm/bridge/sii9234.c                 | 4 ++--
>  drivers/iio/light/bh1780.c                       | 2 +-
>  drivers/leds/leds-pca955x.c                      | 2 +-
>  drivers/leds/leds-tca6507.c                      | 2 +-
>  drivers/media/i2c/ak881x.c                       | 2 +-
>  drivers/media/i2c/mt9m001.c                      | 2 +-
>  drivers/media/i2c/mt9m111.c                      | 2 +-
>  drivers/media/i2c/mt9p031.c                      | 2 +-
>  drivers/media/i2c/ov2640.c                       | 2 +-
>  drivers/media/i2c/tw9910.c                       | 3 +--
>  drivers/misc/fsa9480.c                           | 2 +-
>  drivers/misc/isl29003.c                          | 2 +-
>  drivers/misc/tsl2550.c                           | 2 +-
>  drivers/mtd/maps/pismo.c                         | 2 +-
>  drivers/power/supply/bq24190_charger.c           | 2 +-
>  drivers/power/supply/bq24257_charger.c           | 2 +-
>  drivers/power/supply/bq25890_charger.c           | 2 +-
>  drivers/power/supply/max14656_charger_detector.c | 2 +-
>  drivers/power/supply/max17040_battery.c          | 2 +-
>  drivers/power/supply/max17042_battery.c          | 2 +-
>  drivers/power/supply/rt5033_battery.c            | 2 +-
>  drivers/power/supply/rt9455_charger.c            | 2 +-
>  drivers/power/supply/sbs-manager.c               | 2 +-
>  drivers/regulator/max8952.c                      | 2 +-
>  drivers/rtc/rtc-fm3130.c                         | 8 +++-----
>  drivers/rtc/rtc-m41t80.c                         | 2 +-
>  drivers/rtc/rtc-rv8803.c                         | 2 +-
>  drivers/rtc/rtc-rx8010.c                         | 2 +-
>  drivers/rtc/rtc-rx8025.c                         | 2 +-
>  drivers/staging/media/soc_camera/imx074.c        | 2 +-
>  drivers/staging/media/soc_camera/mt9t031.c       | 2 +-
>  drivers/staging/media/soc_camera/soc_mt9v022.c   | 2 +-
>  drivers/usb/typec/tcpm/fusb302.c                 | 3 +--
>  34 files changed, 37 insertions(+), 41 deletions(-)
> 
> -- 
> 2.19.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2019-06-27 18:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
2019-06-08 10:55 ` [PATCH 16/34] power: supply: bq24190_charger: simplify getting the adapter of a client Wolfram Sang
2019-06-13  9:50   ` Simon Horman
2019-06-08 10:55 ` [PATCH 17/34] power: supply: bq24257_charger: " Wolfram Sang
2019-06-13  9:50   ` Simon Horman
2019-06-08 10:55 ` [PATCH 18/34] power: supply: bq25890_charger: " Wolfram Sang
2019-06-13  9:50   ` Simon Horman
2019-06-08 10:55 ` [PATCH 19/34] power: supply: max14656_charger_detector: " Wolfram Sang
2019-06-13  9:51   ` Simon Horman
2019-06-08 10:55 ` [PATCH 20/34] power: supply: max17040_battery: " Wolfram Sang
2019-06-13  9:52   ` Simon Horman
2019-06-08 10:56 ` [PATCH 21/34] power: supply: max17042_battery: " Wolfram Sang
2019-06-13  9:52   ` Simon Horman
2019-06-08 10:56 ` [PATCH 22/34] power: supply: rt5033_battery: " Wolfram Sang
2019-06-13  9:52   ` Simon Horman
2019-06-08 10:56 ` [PATCH 23/34] power: supply: rt9455_charger: " Wolfram Sang
2019-06-13  9:52   ` Simon Horman
2019-06-08 10:56 ` [PATCH 24/34] power: supply: sbs-manager: " Wolfram Sang
2019-06-13  9:53   ` Simon Horman
2019-06-09 16:37 ` [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Peter Rosin
2019-06-10  7:15   ` Wolfram Sang
2019-06-27 18:28 ` Sebastian Reichel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190627182817.5vrfmuzn7kanvtwu@earth.universe \
    --to=sre@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).