* [PATCH 16/34] power: supply: bq24190_charger: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
@ 2019-06-08 10:55 ` Wolfram Sang
2019-06-13 9:50 ` Simon Horman
2019-06-08 10:55 ` [PATCH 17/34] power: supply: bq24257_charger: " Wolfram Sang
` (9 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:55 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/bq24190_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index cc0dfdc9e85a..ec03521c46d1 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 16/34] power: supply: bq24190_charger: simplify getting the adapter of a client
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
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:50 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:55:55PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/bq24190_charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index cc0dfdc9e85a..ec03521c46d1 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 17/34] power: supply: bq24257_charger: simplify getting the adapter of a client
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-08 10:55 ` Wolfram Sang
2019-06-13 9:50 ` Simon Horman
2019-06-08 10:55 ` [PATCH 18/34] power: supply: bq25890_charger: " Wolfram Sang
` (8 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:55 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/bq24257_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
index 7eb58f10e092..eb151687beb3 100644
--- a/drivers/power/supply/bq24257_charger.c
+++ b/drivers/power/supply/bq24257_charger.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 17/34] power: supply: bq24257_charger: simplify getting the adapter of a client
2019-06-08 10:55 ` [PATCH 17/34] power: supply: bq24257_charger: " Wolfram Sang
@ 2019-06-13 9:50 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:50 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:55:56PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/bq24257_charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
> index 7eb58f10e092..eb151687beb3 100644
> --- a/drivers/power/supply/bq24257_charger.c
> +++ b/drivers/power/supply/bq24257_charger.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 18/34] power: supply: bq25890_charger: simplify getting the adapter of a client
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-08 10:55 ` [PATCH 17/34] power: supply: bq24257_charger: " Wolfram Sang
@ 2019-06-08 10:55 ` Wolfram Sang
2019-06-13 9:50 ` Simon Horman
2019-06-08 10:55 ` [PATCH 19/34] power: supply: max14656_charger_detector: " Wolfram Sang
` (7 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:55 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/bq25890_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index b2ff82b4707a..d333f2b321b9 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 18/34] power: supply: bq25890_charger: simplify getting the adapter of a client
2019-06-08 10:55 ` [PATCH 18/34] power: supply: bq25890_charger: " Wolfram Sang
@ 2019-06-13 9:50 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:50 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:55:57PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/bq25890_charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index b2ff82b4707a..d333f2b321b9 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 19/34] power: supply: max14656_charger_detector: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (2 preceding siblings ...)
2019-06-08 10:55 ` [PATCH 18/34] power: supply: bq25890_charger: " Wolfram Sang
@ 2019-06-08 10:55 ` Wolfram Sang
2019-06-13 9:51 ` Simon Horman
2019-06-08 10:55 ` [PATCH 20/34] power: supply: max17040_battery: " Wolfram Sang
` (6 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:55 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/max14656_charger_detector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/max14656_charger_detector.c b/drivers/power/supply/max14656_charger_detector.c
index 9e6472834e37..f27b780d2c02 100644
--- a/drivers/power/supply/max14656_charger_detector.c
+++ b/drivers/power/supply/max14656_charger_detector.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 19/34] power: supply: max14656_charger_detector: simplify getting the adapter of a client
2019-06-08 10:55 ` [PATCH 19/34] power: supply: max14656_charger_detector: " Wolfram Sang
@ 2019-06-13 9:51 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:51 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:55:58PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/max14656_charger_detector.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/max14656_charger_detector.c b/drivers/power/supply/max14656_charger_detector.c
> index 9e6472834e37..f27b780d2c02 100644
> --- a/drivers/power/supply/max14656_charger_detector.c
> +++ b/drivers/power/supply/max14656_charger_detector.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 20/34] power: supply: max17040_battery: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (3 preceding siblings ...)
2019-06-08 10:55 ` [PATCH 19/34] power: supply: max14656_charger_detector: " Wolfram Sang
@ 2019-06-08 10:55 ` Wolfram Sang
2019-06-13 9:52 ` Simon Horman
2019-06-08 10:56 ` [PATCH 21/34] power: supply: max17042_battery: " Wolfram Sang
` (5 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:55 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/max17040_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index 91cafc7bed30..62499018e68b 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 20/34] power: supply: max17040_battery: simplify getting the adapter of a client
2019-06-08 10:55 ` [PATCH 20/34] power: supply: max17040_battery: " Wolfram Sang
@ 2019-06-13 9:52 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:55:59PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/max17040_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
> index 91cafc7bed30..62499018e68b 100644
> --- a/drivers/power/supply/max17040_battery.c
> +++ b/drivers/power/supply/max17040_battery.c
> @@ -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;
>
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 21/34] power: supply: max17042_battery: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (4 preceding siblings ...)
2019-06-08 10:55 ` [PATCH 20/34] power: supply: max17040_battery: " Wolfram Sang
@ 2019-06-08 10:56 ` Wolfram Sang
2019-06-13 9:52 ` Simon Horman
2019-06-08 10:56 ` [PATCH 22/34] power: supply: rt5033_battery: " Wolfram Sang
` (4 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:56 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/max17042_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 581c6bd23388..64f3358eaa3c 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 21/34] power: supply: max17042_battery: simplify getting the adapter of a client
2019-06-08 10:56 ` [PATCH 21/34] power: supply: max17042_battery: " Wolfram Sang
@ 2019-06-13 9:52 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:56:00PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/max17042_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
> index 581c6bd23388..64f3358eaa3c 100644
> --- a/drivers/power/supply/max17042_battery.c
> +++ b/drivers/power/supply/max17042_battery.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 22/34] power: supply: rt5033_battery: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (5 preceding siblings ...)
2019-06-08 10:56 ` [PATCH 21/34] power: supply: max17042_battery: " Wolfram Sang
@ 2019-06-08 10:56 ` Wolfram Sang
2019-06-13 9:52 ` Simon Horman
2019-06-08 10:56 ` [PATCH 23/34] power: supply: rt9455_charger: " Wolfram Sang
` (3 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:56 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/rt5033_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
index bcdd83048492..508f825ff190 100644
--- a/drivers/power/supply/rt5033_battery.c
+++ b/drivers/power/supply/rt5033_battery.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 22/34] power: supply: rt5033_battery: simplify getting the adapter of a client
2019-06-08 10:56 ` [PATCH 22/34] power: supply: rt5033_battery: " Wolfram Sang
@ 2019-06-13 9:52 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:56:01PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/rt5033_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
> index bcdd83048492..508f825ff190 100644
> --- a/drivers/power/supply/rt5033_battery.c
> +++ b/drivers/power/supply/rt5033_battery.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 23/34] power: supply: rt9455_charger: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (6 preceding siblings ...)
2019-06-08 10:56 ` [PATCH 22/34] power: supply: rt5033_battery: " Wolfram Sang
@ 2019-06-08 10:56 ` Wolfram Sang
2019-06-13 9:52 ` Simon Horman
2019-06-08 10:56 ` [PATCH 24/34] power: supply: sbs-manager: " Wolfram Sang
` (2 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:56 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/rt9455_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/rt9455_charger.c b/drivers/power/supply/rt9455_charger.c
index 40a9d329418a..29161ae90245 100644
--- a/drivers/power/supply/rt9455_charger.c
+++ b/drivers/power/supply/rt9455_charger.c
@@ -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 = {};
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 23/34] power: supply: rt9455_charger: simplify getting the adapter of a client
2019-06-08 10:56 ` [PATCH 23/34] power: supply: rt9455_charger: " Wolfram Sang
@ 2019-06-13 9:52 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:56:02PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/rt9455_charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/rt9455_charger.c b/drivers/power/supply/rt9455_charger.c
> index 40a9d329418a..29161ae90245 100644
> --- a/drivers/power/supply/rt9455_charger.c
> +++ b/drivers/power/supply/rt9455_charger.c
> @@ -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 = {};
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 24/34] power: supply: sbs-manager: simplify getting the adapter of a client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (7 preceding siblings ...)
2019-06-08 10:56 ` [PATCH 23/34] power: supply: rt9455_charger: " Wolfram Sang
@ 2019-06-08 10:56 ` 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-27 18:28 ` Sebastian Reichel
10 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2019-06-08 10:56 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, Sebastian Reichel, linux-pm, linux-kernel
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Please apply to your subsystem tree.
drivers/power/supply/sbs-manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/sbs-manager.c b/drivers/power/supply/sbs-manager.c
index cb6e8f66c7a2..4c29a89df968 100644
--- a/drivers/power/supply/sbs-manager.c
+++ b/drivers/power/supply/sbs-manager.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 24/34] power: supply: sbs-manager: simplify getting the adapter of a client
2019-06-08 10:56 ` [PATCH 24/34] power: supply: sbs-manager: " Wolfram Sang
@ 2019-06-13 9:53 ` Simon Horman
0 siblings, 0 replies; 22+ messages in thread
From: Simon Horman @ 2019-06-13 9:53 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Sebastian Reichel, linux-pm, linux-kernel
On Sat, Jun 08, 2019 at 12:56:03PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Please apply to your subsystem tree.
>
> drivers/power/supply/sbs-manager.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/sbs-manager.c b/drivers/power/supply/sbs-manager.c
> index cb6e8f66c7a2..4c29a89df968 100644
> --- a/drivers/power/supply/sbs-manager.c
> +++ b/drivers/power/supply/sbs-manager.c
> @@ -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;
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (8 preceding siblings ...)
2019-06-08 10:56 ` [PATCH 24/34] power: supply: sbs-manager: " Wolfram Sang
@ 2019-06-09 16:37 ` Peter Rosin
2019-06-10 7:15 ` Wolfram Sang
2019-06-27 18:28 ` Sebastian Reichel
10 siblings, 1 reply; 22+ messages in thread
From: Peter Rosin @ 2019-06-09 16:37 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c
Cc: linux-renesas-soc, devel, dri-devel, linux-arm-kernel, linux-clk,
linux-iio, linux-kernel, linux-leds, linux-media, linux-mtd,
linux-pm, linux-rtc, linux-usb
On 2019-06-08 12:55, 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.
Similar things go on in:
drivers/hwmon/lm90.c
drivers/leds/leds-is31fl319x.c
drivers/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
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client
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
0 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2019-06-10 7:15 UTC (permalink / raw)
To: Peter Rosin
Cc: Wolfram Sang, linux-i2c, linux-renesas-soc, devel, dri-devel,
linux-arm-kernel, linux-clk, linux-iio, linux-kernel, linux-leds,
linux-media, linux-mtd, linux-pm, linux-rtc, linux-usb
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
Hi Peter,
> Similar things go on in:
>
> drivers/hwmon/lm90.c
> drivers/leds/leds-is31fl319x.c
> drivers/of/unittest.c
Right. I'll fix them, too.
> And drivers/rtc/rtc-fm3130.c has a couple of these:
These are fixed in patch 26 of this series.
Thanks and happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client
2019-06-08 10:55 [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Wolfram Sang
` (9 preceding siblings ...)
2019-06-09 16:37 ` [PATCH 00/34] treewide: simplify getting the adapter of an I2C client Peter Rosin
@ 2019-06-27 18:28 ` Sebastian Reichel
10 siblings, 0 replies; 22+ messages in thread
From: Sebastian Reichel @ 2019-06-27 18:28 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-i2c, linux-renesas-soc, devel, dri-devel, linux-arm-kernel,
linux-clk, linux-iio, linux-kernel, linux-leds, linux-media,
linux-mtd, linux-pm, linux-rtc, linux-usb
[-- 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 --]
^ permalink raw reply [flat|nested] 22+ messages in thread