treewide: simplify getting the adapter of an I2C client
Subsystems (24)
cover treewide: simplify getting the adapter of an I2C client
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
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(-)
Signature · 1 line
2.19.1
PATCH 1/34 clk: clk-cdce706: simplify getting the adapter of a client
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/clk/clk-cdce706.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-cdce706.c +1 -1
@@ -633,7 +633,7 @@ of_clk_cdce_get(struct of_phandle_args *clkspec, void *data)static int cdce706_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct cdce706_dev_data *cdce;int ret;
Signature · 1 line
2.19.1
Re: [PATCH 01/34] clk: clk-cdce706: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/clk/clk-cdce706.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/clk-cdce706.c +1
-1@@ -633,7 +633,7 @@ of_clk_cdce_get(struct of_phandle_args *clkspec, void *data)static int cdce706_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct cdce706_dev_data *cdce;int ret;Signature · 1 line
2.19.1
Re: [PATCH 01/34] clk: clk-cdce706: simplify getting the adapter of a client
In reply to Wolfram SangQuoting Wolfram Sang (2019-06-08 03:55:40)
Quoted 5 lines
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Applied to clk-next
PATCH 2/34 gpu: drm: bridge: sii9234: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/gpu/drm/bridge/sii9234.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/sii9234.c +2 -2
@@ -815,7 +815,7 @@ static irqreturn_t sii9234_irq_thread(int irq, void *data)static int sii9234_init_resources (struct sii9234 *ctx,struct i2c_client *client) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!ctx->dev->of_node) {
@@ -897,7 +897,7 @@ static const struct drm_bridge_funcs sii9234_bridge_funcs = {static int sii9234_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct sii9234 *ctx;struct device *dev = &client->dev;int ret;
Signature · 1 line
2.19.1
Re: [PATCH 02/34] gpu: drm: bridge: sii9234: simplify getting the adapter of a client
Hi Wolfram,
Thank you for the patch.
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 29 lines
---
Please apply to your subsystem tree.
drivers/gpu/drm/bridge/sii9234.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/sii9234.c +2
-2@@ -815,7 +815,7 @@ static irqreturn_t sii9234_irq_thread(int irq, void *data)static int sii9234_init_resources (struct sii9234 *ctx,struct i2c_client *client) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!ctx->dev->of_node) {@@ -897,7 +897,7 @@ static const struct drm_bridge_funcs sii9234_bridge_funcs = {static int sii9234_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct sii9234 *ctx;struct device *dev = &client->dev;int ret;
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/34] gpu: drm: bridge: sii9234: simplify getting the adapter of a client
Quoted 10 lines · Laurent Pinchart
Hi Wolfram,
Thank you for the patch.
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>
Queued to drm-misc-next.
Laurent, for unknown reason patchwork does not collect yours tags, and it is not the 1st time, added manually.
--
Regards
Andrzej
Quoted 30 lines
Quoted 30 lines
---
Please apply to your subsystem tree.
drivers/gpu/drm/bridge/sii9234.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/sii9234.c +2
-2@@ -815,7 +815,7 @@ static irqreturn_t sii9234_irq_thread(int irq, void *data)static int sii9234_init_resources (struct sii9234 *ctx,struct i2c_client *client) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!ctx->dev->of_node) {@@ -897,7 +897,7 @@ static const struct drm_bridge_funcs sii9234_bridge_funcs = {static int sii9234_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct sii9234 *ctx;struct device *dev = &client->dev;int ret;
PATCH 3/34 iio: light: bh1780: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/iio/light/bh1780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/bh1780.c +1 -1
@@ -146,7 +146,7 @@ static int bh1780_probe(struct i2c_client *client, {int ret;struct bh1780_data *bh1780; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct iio_dev *indio_dev;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE ))
Signature · 1 line
2.19.1
Jonathan Cameron
maintainerRe: [PATCH 03/34] iio: light: bh1780: simplify getting the adapter of a client
Quoted 4 lines · On Sat, 8 Jun 2019 12:55:42 +0200 Wolfram Sang…
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 20 lines
---
Please apply to your subsystem tree.
drivers/iio/light/bh1780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/bh1780.c +1
-1@@ -146,7 +146,7 @@ static int bh1780_probe(struct i2c_client *client, {int ret;struct bh1780_data *bh1780; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct iio_dev *indio_dev;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE ))
PATCH 4/34 leds: leds-pca955x: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-pca955x.c +1 -1
@@ -432,7 +432,7 @@ static int pca955x_probe(struct i2c_client *client,int ngpios =0 ; chip = &pca955x_chipdefs[id->driver_data]; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!pdata) { pdata =pca955x_get_pdata (client, chip);
Signature · 1 line
2.19.1
Re: [PATCH 04/34] leds: leds-pca955x: simplify getting the adapter of a client
Hi Wolfram,
Thank you for the patches.
Quoted 17 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-pca955x.c +0
-0
drivers/leds/leds-pca955x.c static int pca955x_probe(struct i2c_client *client, · line 438
Quoted 8 lines
drivers/leds/leds-pca955x.c +1
-1@@ -432,7 +432,7 @@ static int pca955x_probe(struct i2c_client *client,int ngpios =0 ; chip = &pca955x_chipdefs[id->driver_data]; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!pdata) { pdata =pca955x_get_pdata (client, chip);
For both 4/34 and 5/34:
Signature · 2 lines
Best regards, Jacek Anaszewski
Pavel Machek
Acked-byRe: [PATCH 04/34] leds: leds-pca955x: simplify getting the adapter of a client
Quoted 32 lines · Jacek Anaszewski
Hi Wolfram,
Thank you for the patches.
Quoted 16 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-pca955x.c +0
-0drivers/leds/leds-pca955x.c static int pca955x_probe(struct i2c_client *client, · line 438
Quoted 8 lines
drivers/leds/leds-pca955x.c +1
-1@@ -432,7 +432,7 @@ static int pca955x_probe(struct i2c_client *client,int ngpios =0 ; chip = &pca955x_chipdefs[id->driver_data]; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!pdata) { pdata =pca955x_get_pdata (client, chip);For both 4/34 and 5/34:
Quoted 1 line
Acked-by Jacek Anaszewski <[email protected]>
4 and 5:
But I wonder if it should go through the leds tree?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [PATCH 04/34] leds: leds-pca955x: simplify getting the adapter of a client
Quoted 33 lines · Pavel Machek
Quoted 32 lines · Jacek Anaszewski
Hi Wolfram,
Thank you for the patches.
Quoted 16 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-pca955x.c +0
-0drivers/leds/leds-pca955x.c static int pca955x_probe(struct i2c_client *client, · line 438
Quoted 8 lines
drivers/leds/leds-pca955x.c +1
-1@@ -432,7 +432,7 @@ static int pca955x_probe(struct i2c_client *client,int ngpios =0 ; chip = &pca955x_chipdefs[id->driver_data]; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!pdata) { pdata =pca955x_get_pdata (client, chip);For both 4/34 and 5/34:
Quoted 7 lines
Quoted 1 line
Acked-by Jacek Anaszewski <[email protected]>4 and 5:
Acked-by Pavel Machek <[email protected]>But I wonder if it should go through the leds tree?
Yes, I missed that "Please apply to your subsystem tree." comment. And this change relies on the existing code.
Applied 4/34 and 5/34 to the for-next branch of linux-leds.git.
Thanks.
Signature · 2 lines
Best regards, Jacek Anaszewski
PATCH 5/34 leds: leds-tca6507: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/leds/leds-tca6507.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-tca6507.c +1 -1
@@ -758,7 +758,7 @@ static int tca6507_probe(struct i2c_client *client,int err;int i =0 ; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!i2c_check_functionality (adapter,I2C_FUNC_I2C ))
Signature · 1 line
2.19.1
Re: [PATCH 05/34] leds: leds-tca6507: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/leds/leds-tca6507.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-tca6507.c +1
-1@@ -758,7 +758,7 @@ static int tca6507_probe(struct i2c_client *client,int err;int i =0 ; - adapter =to_i2c_adapter (client->dev.parent); + adapter = client->adapter; pdata =dev_get_platdata (&client->dev);if (!i2c_check_functionality (adapter,I2C_FUNC_I2C ))Signature · 1 line
2.19.1
PATCH 6/34 media: i2c: ak881x: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/ak881x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ak881x.c +1 -1
@@ -232,7 +232,7 @@ static const struct v4l2_subdev_ops ak881x_subdev_ops = {static int ak881x_probe (struct i2c_client *client,const struct i2c_device_id *did) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct ak881x *ak881x;u8 ifmode, data;
Signature · 1 line
2.19.1
Re: [PATCH 06/34] media: i2c: ak881x: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/media/i2c/ak881x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/ak881x.c +1
-1@@ -232,7 +232,7 @@ static const struct v4l2_subdev_ops ak881x_subdev_ops = {static int ak881x_probe (struct i2c_client *client,const struct i2c_device_id *did) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct ak881x *ak881x;u8 ifmode, data;Signature · 1 line
2.19.1
PATCH 7/34 media: i2c: mt9m001: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/mt9m001.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9m001.c +1 -1
@@ -730,7 +730,7 @@ static int mt9m001_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct mt9m001 *mt9m001; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_WORD_DATA )) {
Signature · 1 line
2.19.1
Re: [PATCH 07/34] media: i2c: mt9m001: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
PATCH 8/34 media: i2c: mt9m111: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/mt9m111.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9m111.c +1 -1
@@ -1235,7 +1235,7 @@ static int mt9m111_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct mt9m111 *mt9m111; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_WORD_DATA )) {
Signature · 1 line
2.19.1
Re: [PATCH 08/34] media: i2c: mt9m111: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/media/i2c/mt9m111.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/mt9m111.c +1
-1@@ -1235,7 +1235,7 @@ static int mt9m111_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct mt9m111 *mt9m111; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_WORD_DATA )) {Signature · 1 line
2.19.1
PATCH 9/34 media: i2c: mt9p031: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/mt9p031.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9p031.c +1 -1
@@ -1034,7 +1034,7 @@ static int mt9p031_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct mt9p031_platform_data *pdata =mt9p031_get_pdata (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct mt9p031 *mt9p031;unsigned int i;int ret;
Signature · 1 line
2.19.1
Re: [PATCH 09/34] media: i2c: mt9p031: simplify getting the adapter of a client
Hi Wolfram,
Thank you for the patch.
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
and taken in my tree.
Quoted 20 lines
---
Please apply to your subsystem tree.
drivers/media/i2c/mt9p031.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/mt9p031.c +1
-1@@ -1034,7 +1034,7 @@ static int mt9p031_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct mt9p031_platform_data *pdata =mt9p031_get_pdata (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct mt9p031 *mt9p031;unsigned int i;int ret;
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 10/34 media: i2c: ov2640: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +1 -1
@@ -1197,7 +1197,7 @@ static int ov2640_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct ov2640_priv *priv; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE_DATA )) {
Signature · 1 line
2.19.1
Re: [PATCH 10/34] media: i2c: ov2640: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/media/i2c/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/ov2640.c +1
-1@@ -1197,7 +1197,7 @@ static int ov2640_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct ov2640_priv *priv; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE_DATA )) {Signature · 1 line
2.19.1
PATCH 11/34 media: i2c: tw9910: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/media/i2c/tw9910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/tw9910.c +1 -2
@@ -934,8 +934,7 @@ static int tw9910_probe(struct i2c_client *client, {struct tw9910_priv *priv;struct tw9910_video_info *info; -struct i2c_adapter *adapter = -to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!client->dev.platform_data) {
Signature · 1 line
2.19.1
Re: [PATCH 11/34] media: i2c: tw9910: simplify getting the adapter of a client
Quoted 5 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Quoted 23 lines
Please apply to your subsystem tree.
drivers/media/i2c/tw9910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/media/i2c/tw9910.c +1
-2@@ -934,8 +934,7 @@ static int tw9910_probe(struct i2c_client *client, {struct tw9910_priv *priv;struct tw9910_video_info *info; -struct i2c_adapter *adapter = -to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!client->dev.platform_data) {Signature · 1 line
2.19.1
PATCH 12/34 misc: fsa9480: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/misc/fsa9480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fsa9480.c +1 -1
@@ -410,7 +410,7 @@ static int fsa9480_irq_init(struct fsa9480_usbsw *usbsw)static int fsa9480_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct fsa9480_usbsw *usbsw;int ret =0 ;
Signature · 1 line
2.19.1
Re: [PATCH 12/34] misc: fsa9480: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/misc/fsa9480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/fsa9480.c +1
-1@@ -410,7 +410,7 @@ static int fsa9480_irq_init(struct fsa9480_usbsw *usbsw)static int fsa9480_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct fsa9480_usbsw *usbsw;int ret =0 ;Signature · 1 line
2.19.1
PATCH 13/34 misc: isl29003: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/misc/isl29003.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/isl29003.c +1 -1
@@ -377,7 +377,7 @@ static int isl29003_init_client(struct i2c_client *client)static int isl29003_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct isl29003_data *data;int err =0 ;
Signature · 1 line
2.19.1
Re: [PATCH 13/34] misc: isl29003: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/misc/isl29003.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/isl29003.c +1
-1@@ -377,7 +377,7 @@ static int isl29003_init_client(struct i2c_client *client)static int isl29003_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct isl29003_data *data;int err =0 ;Signature · 1 line
2.19.1
PATCH 14/34 misc: tsl2550: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/misc/tsl2550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/tsl2550.c +1 -1
@@ -336,7 +336,7 @@ static struct i2c_driver tsl2550_driver;static int tsl2550_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct tsl2550_data *data;int *opmode, err =0 ;
Signature · 1 line
2.19.1
Re: [PATCH 14/34] misc: tsl2550: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/misc/tsl2550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/tsl2550.c +1
-1@@ -336,7 +336,7 @@ static struct i2c_driver tsl2550_driver;static int tsl2550_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct tsl2550_data *data;int *opmode, err =0 ;Signature · 1 line
2.19.1
PATCH 15/34 mtd: maps: pismo: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/mtd/maps/pismo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/pismo.c +1 -1
@@ -211,7 +211,7 @@ static int pismo_remove(struct i2c_client *client)static int pismo_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct pismo_pdata *pdata = client->dev.platform_data;struct pismo_eeprom eeprom;struct pismo_data *pismo;
Signature · 6 lines
2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH 15/34] mtd: maps: pismo: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/mtd/maps/pismo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/maps/pismo.c +1
-1@@ -211,7 +211,7 @@ static int pismo_remove(struct i2c_client *client)static int pismo_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct pismo_pdata *pdata = client->dev.platform_data;struct pismo_eeprom eeprom;struct pismo_data *pismo;Signature · 1 line
2.19.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 16/34 power: supply: bq24190_charger: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/bq24190_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq24190_charger.c +1 -1
@@ -1700,7 +1700,7 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi)static int bq24190_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct power_supply_config charger_cfg = {}, battery_cfg = {};struct bq24190_dev_info *bdi;
Signature · 1 line
2.19.1
Re: [PATCH 16/34] power: supply: bq24190_charger: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/bq24190_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/bq24190_charger.c +1
-1@@ -1700,7 +1700,7 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi)static int bq24190_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct power_supply_config charger_cfg = {}, battery_cfg = {};struct bq24190_dev_info *bdi;Signature · 1 line
2.19.1
PATCH 17/34 power: supply: bq24257_charger: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/bq24257_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq24257_charger.c +1 -1
@@ -950,7 +950,7 @@ static int bq24257_fw_probe(struct bq24257_device *bq)static int bq24257_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;const struct acpi_device_id *acpi_id;struct bq24257_device *bq;
Signature · 1 line
2.19.1
Re: [PATCH 17/34] power: supply: bq24257_charger: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/bq24257_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/bq24257_charger.c +1
-1@@ -950,7 +950,7 @@ static int bq24257_fw_probe(struct bq24257_device *bq)static int bq24257_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;const struct acpi_device_id *acpi_id;struct bq24257_device *bq;Signature · 1 line
2.19.1
PATCH 18/34 power: supply: bq25890_charger: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/bq25890_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq25890_charger.c +1 -1
@@ -817,7 +817,7 @@ static int bq25890_fw_probe(struct bq25890_device *bq)static int bq25890_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct bq25890_device *bq;int ret;
Signature · 1 line
2.19.1
Re: [PATCH 18/34] power: supply: bq25890_charger: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/bq25890_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/bq25890_charger.c +1
-1@@ -817,7 +817,7 @@ static int bq25890_fw_probe(struct bq25890_device *bq)static int bq25890_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct bq25890_device *bq;int ret;Signature · 1 line
2.19.1
PATCH 19/34 power: supply: max14656_charger_detector: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/max14656_charger_detector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/max14656_charger_detector.c +1 -1
@@ -251,7 +251,7 @@ static void stop_irq_work(void *data)static int max14656_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct power_supply_config psy_cfg = {};struct max14656_chip *chip;
Signature · 1 line
2.19.1
Re: [PATCH 19/34] power: supply: max14656_charger_detector: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/max14656_charger_detector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/max14656_charger_detector.c +1
-1@@ -251,7 +251,7 @@ static void stop_irq_work(void *data)static int max14656_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct power_supply_config psy_cfg = {};struct max14656_chip *chip;Signature · 1 line
2.19.1
PATCH 20/34 power: supply: max17040_battery: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/max17040_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/max17040_battery.c +1 -1
@@ -193,7 +193,7 @@ static const struct power_supply_desc max17040_battery_desc = {static int max17040_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct power_supply_config psy_cfg = {};struct max17040_chip *chip;
Signature · 1 line
2.19.1
Re: [PATCH 20/34] power: supply: max17040_battery: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/max17040_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/max17040_battery.c +1
-1@@ -193,7 +193,7 @@ static const struct power_supply_desc max17040_battery_desc = {static int max17040_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct power_supply_config psy_cfg = {};struct max17040_chip *chip;Signature · 1 line
2.19.1
PATCH 21/34 power: supply: max17042_battery: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/max17042_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/max17042_battery.c +1 -1
@@ -1005,7 +1005,7 @@ static void max17042_stop_work(void *data)static int max17042_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;const struct power_supply_desc *max17042_desc = &max17042_psy_desc;struct power_supply_config psy_cfg = {};const struct acpi_device_id *acpi_id =NULL ;
Signature · 1 line
2.19.1
Re: [PATCH 21/34] power: supply: max17042_battery: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/max17042_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/max17042_battery.c +1
-1@@ -1005,7 +1005,7 @@ static void max17042_stop_work(void *data)static int max17042_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;const struct power_supply_desc *max17042_desc = &max17042_psy_desc;struct power_supply_config psy_cfg = {};const struct acpi_device_id *acpi_id =NULL ;Signature · 1 line
2.19.1
PATCH 22/34 power: supply: rt5033_battery: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/rt5033_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/rt5033_battery.c +1 -1
@@ -118,7 +118,7 @@ static const struct power_supply_desc rt5033_battery_desc = {static int rt5033_battery_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct power_supply_config psy_cfg = {};struct rt5033_battery *battery;u32 ret;
Signature · 1 line
2.19.1
Re: [PATCH 22/34] power: supply: rt5033_battery: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/rt5033_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/rt5033_battery.c +1
-1@@ -118,7 +118,7 @@ static const struct power_supply_desc rt5033_battery_desc = {static int rt5033_battery_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct power_supply_config psy_cfg = {};struct rt5033_battery *battery;u32 ret;Signature · 1 line
2.19.1
PATCH 23/34 power: supply: rt9455_charger: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/rt9455_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/rt9455_charger.c +1 -1
@@ -1584,7 +1584,7 @@ static const struct regmap_config rt9455_regmap_config = {static int rt9455_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct rt9455_info *info;struct power_supply_config rt9455_charger_config = {};
Signature · 1 line
2.19.1
Re: [PATCH 23/34] power: supply: rt9455_charger: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/rt9455_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/rt9455_charger.c +1
-1@@ -1584,7 +1584,7 @@ static const struct regmap_config rt9455_regmap_config = {static int rt9455_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;struct rt9455_info *info;struct power_supply_config rt9455_charger_config = {};Signature · 1 line
2.19.1
PATCH 24/34 power: supply: sbs-manager: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/power/supply/sbs-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/sbs-manager.c +1 -1
@@ -317,7 +317,7 @@ static const struct power_supply_desc sbsm_default_psy_desc = {static int sbsm_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct sbsm_data *data;struct device *dev = &client->dev;struct power_supply_desc *psy_desc;
Signature · 1 line
2.19.1
Re: [PATCH 24/34] power: supply: sbs-manager: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/power/supply/sbs-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/sbs-manager.c +1
-1@@ -317,7 +317,7 @@ static const struct power_supply_desc sbsm_default_psy_desc = {static int sbsm_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct sbsm_data *data;struct device *dev = &client->dev;struct power_supply_desc *psy_desc;Signature · 1 line
2.19.1
PATCH 25/34 regulator: max8952: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/regulator/max8952.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max8952.c +1 -1
@@ -179,7 +179,7 @@ static struct max8952_platform_data *max8952_parse_dt(struct device *dev)static int max8952_pmic_probe (struct i2c_client *client,const struct i2c_device_id *i2c_id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct max8952_platform_data *pdata =dev_get_platdata (&client->dev);struct regulator_config config = { };struct max8952_data *max8952;
Signature · 1 line
2.19.1
Mark Brown
maintainerApplied "regulator: max8952: simplify getting the adapter of a client" to the regulator tree
The patch
regulator: max8952: simplify getting the adapter of a client
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
6b96092a6bfa65566dda2f5a68a559a743b8d132Mon Sep 17 00:00:00 2001
From: Wolfram Sang <[email protected]>
Date: Sat, 8 Jun 2019 12:56:04 +0200
Subject: [PATCH] regulator: max8952: simplify getting the adapter of a client
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
--- drivers/regulator/max8952.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max8952.c +1 -1
@@ -192,7 +192,7 @@ static struct max8952_platform_data *max8952_parse_dt(struct device *dev)static int max8952_pmic_probe (struct i2c_client *client,const struct i2c_device_id *i2c_id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct max8952_platform_data *pdata =dev_get_platdata (&client->dev);struct regulator_config config = { };struct max8952_data *max8952;
Signature · 1 line
2.20.1
PATCH 26/34 rtc: fm3130: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/rtc/rtc-fm3130.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/rtc/rtc-fm3130.c +3 -5
@@ -107,8 +107,7 @@ static int fm3130_get_time(struct device *dev, struct rtc_time *t)fm3130_rtc_mode (dev,FM3130_MODE_READ );/* read the RTC date and time registers all at once */ - tmp =i2c_transfer (to_i2c_adapter (fm3130->client->dev.parent), - fm3130->msg,2 ); + tmp =i2c_transfer (fm3130->client->adapter, fm3130->msg,2 );if (tmp !=2 ) {dev_err (dev,"%s error %d\n" ,"read" , tmp);return -EIO ;
@@ -200,8 +199,7 @@ static int fm3130_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) }/* read the RTC alarm registers all at once */ - tmp =i2c_transfer (to_i2c_adapter (fm3130->client->dev.parent), - &fm3130->msg[2 ],2 ); + tmp =i2c_transfer (fm3130->client->adapter, &fm3130->msg[2 ],2 );if (tmp !=2 ) {dev_err (dev,"%s error %d\n" ,"read" , tmp);return -EIO ;
@@ -351,7 +349,7 @@ static int fm3130_probe(struct i2c_client *client,struct fm3130 *fm3130;int err = -ENODEV ;int tmp; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;if (!i2c_check_functionality (adapter,I2C_FUNC_I2C |I2C_FUNC_SMBUS_WRITE_BYTE_DATA ))
Signature · 1 line
2.19.1
Re: [PATCH 26/34] rtc: fm3130: simplify getting the adapter of a client
Quoted 11 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/rtc/rtc-fm3130.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 27/34 rtc: m41t80: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/rtc/rtc-m41t80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-m41t80.c +1 -1
@@ -876,7 +876,7 @@ static struct notifier_block wdt_notifier = {static int m41t80_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int rc =0 ;struct rtc_time tm;struct m41t80_data *m41t80_data =NULL ;
Signature · 1 line
2.19.1
Re: [PATCH 27/34] rtc: m41t80: simplify getting the adapter of a client
Quoted 11 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/rtc/rtc-m41t80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 28/34 rtc: rv8803: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/rtc/rtc-rv8803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-rv8803.c +1 -1
@@ -517,7 +517,7 @@ static int rx8900_trickle_charger_init(struct rv8803_data *rv8803)static int rv8803_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct rv8803_data *rv8803;int err, flags;struct nvmem_config nvmem_cfg = {
Signature · 1 line
2.19.1
Re: [PATCH 28/34] rtc: rv8803: simplify getting the adapter of a client
Quoted 11 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/rtc/rtc-rv8803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 29/34 rtc: rx8010: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/rtc/rtc-rx8010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-rx8010.c +1 -1
@@ -437,7 +437,7 @@ static struct rtc_class_ops rx8010_rtc_ops = {static int rx8010_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct rx8010_data *rx8010;int err =0 ;
Signature · 1 line
2.19.1
Re: [PATCH 29/34] rtc: rx8010: simplify getting the adapter of a client
Quoted 11 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/rtc/rtc-rx8010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 30/34 rtc: rx8025: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/rtc/rtc-rx8025.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-rx8025.c +1 -1
@@ -504,7 +504,7 @@ static void rx8025_sysfs_unregister(struct device *dev)static int rx8025_probe (struct i2c_client *client,const struct i2c_device_id *id) { -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct rx8025_data *rx8025;int err =0 ;
Signature · 1 line
2.19.1
Re: [PATCH 30/34] rtc: rx8025: simplify getting the adapter of a client
Quoted 11 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>---
Please apply to your subsystem tree.
drivers/rtc/rtc-rx8025.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 31/34 staging: media: soc_camera: imx074: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/imx074.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/soc_camera/imx074.c +1 -1
@@ -409,7 +409,7 @@ static int imx074_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct imx074 *priv; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client);int ret;
Signature · 1 line
2.19.1
Re: [PATCH 31/34] staging: media: soc_camera: imx074: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/imx074.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/soc_camera/imx074.c +1
-1@@ -409,7 +409,7 @@ static int imx074_probe(struct i2c_client *client, const struct i2c_device_id *did) {struct imx074 *priv; -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client);int ret;Signature · 1 line
2.19.1
PATCH 32/34 staging: media: soc_camera: mt9t031: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/mt9t031.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/soc_camera/mt9t031.c +1 -1
@@ -751,7 +751,7 @@ static int mt9t031_probe(struct i2c_client *client, {struct mt9t031 *mt9t031;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!ssdd) {
Signature · 1 line
2.19.1
Re: [PATCH 32/34] staging: media: soc_camera: mt9t031: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/mt9t031.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/soc_camera/mt9t031.c +1
-1@@ -751,7 +751,7 @@ static int mt9t031_probe(struct i2c_client *client, {struct mt9t031 *mt9t031;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;int ret;if (!ssdd) {Signature · 1 line
2.19.1
PATCH 33/34 staging: media: soc_camera: soc_mt9v022: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/soc_mt9v022.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/soc_camera/soc_mt9v022.c +1 -1
@@ -883,7 +883,7 @@ static int mt9v022_probe(struct i2c_client *client, {struct mt9v022 *mt9v022;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct mt9v022_platform_data *pdata;int ret;
Signature · 1 line
2.19.1
Re: [PATCH 33/34] staging: media: soc_camera: soc_mt9v022: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 23 lines
---
Please apply to your subsystem tree.
drivers/staging/media/soc_camera/soc_mt9v022.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/soc_camera/soc_mt9v022.c +1
-1@@ -883,7 +883,7 @@ static int mt9v022_probe(struct i2c_client *client, {struct mt9v022 *mt9v022;struct soc_camera_subdev_desc *ssdd =soc_camera_i2c_to_desc (client); -struct i2c_adapter *adapter =to_i2c_adapter (client->dev.parent); +struct i2c_adapter *adapter = client->adapter;struct mt9v022_platform_data *pdata;int ret;Signature · 1 line
2.19.1
PATCH 34/34 usb: typec: tcpm: fusb302: simplify getting the adapter of a client
In reply to Wolfram SangWe have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
---
Please apply to your subsystem tree.
drivers/usb/typec/tcpm/fusb302.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/typec/tcpm/fusb302.c +1 -2
@@ -1697,13 +1697,12 @@ static int fusb302_probe(struct i2c_client *client, const struct i2c_device_id *id) {struct fusb302_chip *chip; -struct i2c_adapter *adapter; +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;const char *name;int ret =0 ;u32 v; - adapter =to_i2c_adapter (client->dev.parent);if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_I2C_BLOCK )) {dev_err (&client->dev,"I2C/SMBus block functionality not supported!\n" );
Signature · 1 line
2.19.1
Re: [PATCH 34/34] usb: typec: tcpm: fusb302: simplify getting the adapter of a client
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 27 lines
---
Please apply to your subsystem tree.
drivers/usb/typec/tcpm/fusb302.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/typec/tcpm/fusb302.c +1
-2@@ -1697,13 +1697,12 @@ static int fusb302_probe(struct i2c_client *client, const struct i2c_device_id *id) {struct fusb302_chip *chip; -struct i2c_adapter *adapter; +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;const char *name;int ret =0 ;u32 v; - adapter =to_i2c_adapter (client->dev.parent);if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_I2C_BLOCK )) {dev_err (&client->dev,"I2C/SMBus block functionality not supported!\n" );
Simon Horman
Reviewed-byRe: [PATCH 34/34] usb: typec: tcpm: fusb302: simplify getting the adapter of a client
Quoted 7 lines · Guenter Roeck
Quoted 4 lines · Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved.
Signed-off-by Wolfram Sang <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Quoted 28 lines
Quoted 27 lines
---
Please apply to your subsystem tree.
drivers/usb/typec/tcpm/fusb302.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/typec/tcpm/fusb302.c +1
-2@@ -1697,13 +1697,12 @@ static int fusb302_probe(struct i2c_client *client, const struct i2c_device_id *id) {struct fusb302_chip *chip; -struct i2c_adapter *adapter; +struct i2c_adapter *adapter = client->adapter;struct device *dev = &client->dev;const char *name;int ret =0 ;u32 v; - adapter =to_i2c_adapter (client->dev.parent);if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_I2C_BLOCK )) {dev_err (&client->dev,"I2C/SMBus block functionality not supported!\n" );
Quoted 17 lines · Wolfram Sang
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->adapterThese 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.
Quoted 6 lines
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.
Similar things go on in:
drivers/hwmon/lm90.cdrivers/leds/leds-is31fl319x.cdrivers/of/unittest.c
Those have this pattern:
struct device *dev = &client->dev; struct i2c_adapter *adapter = to_i2c_adapter(dev->parent);
And drivers/rtc/rtc-fm3130.c has a couple of these:
tmp = i2c_transfer(to_i2c_adapter(fm3130->client->dev.parent), ...);
where fm3130->client is of type "struct i2c_client *"
Cheers,
Peter
Hi Peter,
Quoted 5 lines
Similar things go on in:
drivers/hwmon/lm90.cdrivers/leds/leds-is31fl319x.cdrivers/of/unittest.c
Right. I'll fix them, too.
Quoted 1 line
And
drivers/rtc/rtc-fm3130.chas a couple of these:
These are fixed in patch 26 of this series.
Thanks and happy hacking,
Wolfram
Sebastian Reichel
maintainerHi,
Quoted 26 lines · Wolfram Sang
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->adapterThese 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:
Quoted 8 lines
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.giti2c/no_to_adapterPlease 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
Quoted 77 lines
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 clientdrivers/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(-)Signature · 1 line
2.19.1