linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter
@ 2018-10-03 15:50 Luca Ceresoli
  2018-10-03 15:50 ` [PATCH v2 2/3] i2c: mux: ltc4306: " Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Luca Ceresoli @ 2018-10-03 15:50 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-kernel, Luca Ceresoli, Peter Rosin, Vadim Pasternak,
	Michael Shych, Michael Hennerich

From: Luca Ceresoli <luca@lucaceresoli.net>

struct i2c_client has a direct pointer to the adapter, no need to dig
it out of the struct device tree.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 24bd9275fde5..bfabf985e830 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -347,7 +347,7 @@ static void pca954x_cleanup(struct i2c_mux_core *muxc)
 static int pca954x_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
-	struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
+	struct i2c_adapter *adap = client->adapter;
 	struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev);
 	struct device *dev = &client->dev;
 	struct device_node *np = dev->of_node;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] i2c: mux: ltc4306: simplify code to reach the adapter
  2018-10-03 15:50 [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
@ 2018-10-03 15:50 ` Luca Ceresoli
  2018-10-05 11:43   ` Wolfram Sang
  2018-10-03 15:50 ` [PATCH v2 3/3] i2c: mux: mlxcpld: " Luca Ceresoli
  2018-10-05 11:43 ` [PATCH v2 1/3] i2c: mux: pca954x: " Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Luca Ceresoli @ 2018-10-03 15:50 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-kernel, Luca Ceresoli, Peter Rosin, Vadim Pasternak,
	Michael Shych, Michael Hennerich

From: Luca Ceresoli <luca@lucaceresoli.net>

struct i2c_client has a direct pointer to the adapter, no need to dig
it out of the struct device tree.

Suggested-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/i2c/muxes/i2c-mux-ltc4306.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c
index a9af93259b19..83a714605cd6 100644
--- a/drivers/i2c/muxes/i2c-mux-ltc4306.c
+++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c
@@ -208,7 +208,7 @@ MODULE_DEVICE_TABLE(of, ltc4306_of_match);
 
 static int ltc4306_probe(struct i2c_client *client)
 {
-	struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
+	struct i2c_adapter *adap = client->adapter;
 	const struct chip_desc *chip;
 	struct i2c_mux_core *muxc;
 	struct ltc4306 *data;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] i2c: mux: mlxcpld: simplify code to reach the adapter
  2018-10-03 15:50 [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
  2018-10-03 15:50 ` [PATCH v2 2/3] i2c: mux: ltc4306: " Luca Ceresoli
@ 2018-10-03 15:50 ` Luca Ceresoli
  2018-10-05 11:43   ` Wolfram Sang
  2018-10-05 11:43 ` [PATCH v2 1/3] i2c: mux: pca954x: " Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Luca Ceresoli @ 2018-10-03 15:50 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-kernel, Luca Ceresoli, Peter Rosin, Vadim Pasternak,
	Michael Shych, Michael Hennerich

From: Luca Ceresoli <luca@lucaceresoli.net>

struct i2c_client has a direct pointer to the adapter, no need to dig
it out of the struct device tree.

Suggested-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/i2c/muxes/i2c-mux-mlxcpld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/muxes/i2c-mux-mlxcpld.c b/drivers/i2c/muxes/i2c-mux-mlxcpld.c
index f2bf3e57ed67..5ed55ca4fe93 100644
--- a/drivers/i2c/muxes/i2c-mux-mlxcpld.c
+++ b/drivers/i2c/muxes/i2c-mux-mlxcpld.c
@@ -132,7 +132,7 @@ static int mlxcpld_mux_deselect(struct i2c_mux_core *muxc, u32 chan)
 static int mlxcpld_mux_probe(struct i2c_client *client,
 			     const struct i2c_device_id *id)
 {
-	struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
+	struct i2c_adapter *adap = client->adapter;
 	struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&client->dev);
 	struct i2c_mux_core *muxc;
 	int num, force;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter
  2018-10-03 15:50 [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
  2018-10-03 15:50 ` [PATCH v2 2/3] i2c: mux: ltc4306: " Luca Ceresoli
  2018-10-03 15:50 ` [PATCH v2 3/3] i2c: mux: mlxcpld: " Luca Ceresoli
@ 2018-10-05 11:43 ` Wolfram Sang
  2018-10-08 21:48   ` Peter Rosin
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2018-10-05 11:43 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: linux-i2c, linux-kernel, Luca Ceresoli, Peter Rosin,
	Vadim Pasternak, Michael Shych, Michael Hennerich

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

On Wed, Oct 03, 2018 at 05:50:22PM +0200, Luca Ceresoli wrote:
> From: Luca Ceresoli <luca@lucaceresoli.net>
> 
> struct i2c_client has a direct pointer to the adapter, no need to dig
> it out of the struct device tree.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

I like such cleanups!

Acked-by: Wolfram Sang <wsa@the-dreams.de>


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] i2c: mux: ltc4306: simplify code to reach the adapter
  2018-10-03 15:50 ` [PATCH v2 2/3] i2c: mux: ltc4306: " Luca Ceresoli
@ 2018-10-05 11:43   ` Wolfram Sang
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-10-05 11:43 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: linux-i2c, linux-kernel, Luca Ceresoli, Peter Rosin,
	Vadim Pasternak, Michael Shych, Michael Hennerich

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

On Wed, Oct 03, 2018 at 05:50:23PM +0200, Luca Ceresoli wrote:
> From: Luca Ceresoli <luca@lucaceresoli.net>
> 
> struct i2c_client has a direct pointer to the adapter, no need to dig
> it out of the struct device tree.
> 
> Suggested-by: Peter Rosin <peda@axentia.se>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Acked-by: Wolfram Sang <wsa@the-dreams.de>


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/3] i2c: mux: mlxcpld: simplify code to reach the adapter
  2018-10-03 15:50 ` [PATCH v2 3/3] i2c: mux: mlxcpld: " Luca Ceresoli
@ 2018-10-05 11:43   ` Wolfram Sang
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-10-05 11:43 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: linux-i2c, linux-kernel, Luca Ceresoli, Peter Rosin,
	Vadim Pasternak, Michael Shych, Michael Hennerich

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

On Wed, Oct 03, 2018 at 05:50:24PM +0200, Luca Ceresoli wrote:
> From: Luca Ceresoli <luca@lucaceresoli.net>
> 
> struct i2c_client has a direct pointer to the adapter, no need to dig
> it out of the struct device tree.
> 
> Suggested-by: Peter Rosin <peda@axentia.se>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Acked-by: Wolfram Sang <wsa@the-dreams.de>


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter
  2018-10-05 11:43 ` [PATCH v2 1/3] i2c: mux: pca954x: " Wolfram Sang
@ 2018-10-08 21:48   ` Peter Rosin
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Rosin @ 2018-10-08 21:48 UTC (permalink / raw)
  To: Wolfram Sang, Luca Ceresoli
  Cc: linux-i2c, linux-kernel, Luca Ceresoli, Vadim Pasternak,
	Michael Shych, Michael Hennerich

On 2018-10-05 13:43, Wolfram Sang wrote:
> On Wed, Oct 03, 2018 at 05:50:22PM +0200, Luca Ceresoli wrote:
>> From: Luca Ceresoli <luca@lucaceresoli.net>
>>
>> struct i2c_client has a direct pointer to the adapter, no need to dig
>> it out of the struct device tree.
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> 
> I like such cleanups!

Me too!

All three patches applied to for-next. Thanks!

Cheers,
Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-08 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 15:50 [PATCH v2 1/3] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
2018-10-03 15:50 ` [PATCH v2 2/3] i2c: mux: ltc4306: " Luca Ceresoli
2018-10-05 11:43   ` Wolfram Sang
2018-10-03 15:50 ` [PATCH v2 3/3] i2c: mux: mlxcpld: " Luca Ceresoli
2018-10-05 11:43   ` Wolfram Sang
2018-10-05 11:43 ` [PATCH v2 1/3] i2c: mux: pca954x: " Wolfram Sang
2018-10-08 21:48   ` Peter Rosin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).