* [PATCH RESEND] i2c: mux: pca954x: simplify code to reach the adapter
@ 2018-09-26 8:35 Luca Ceresoli
2018-10-01 11:49 ` Peter Rosin
0 siblings, 1 reply; 3+ messages in thread
From: Luca Ceresoli @ 2018-09-26 8:35 UTC (permalink / raw)
To: linux-i2c; +Cc: Peter Rosin, linux-kernel, Luca Ceresoli
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>
---
Sorry for the RESEND noise, but my provider and vger are not
interacting (again). I'll solve the issue at its root ASAP, but in the
meanwhile I'm sending from a different account.
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] 3+ messages in thread
* Re: [PATCH RESEND] i2c: mux: pca954x: simplify code to reach the adapter
2018-09-26 8:35 [PATCH RESEND] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
@ 2018-10-01 11:49 ` Peter Rosin
2018-10-01 20:44 ` Luca Ceresoli
0 siblings, 1 reply; 3+ messages in thread
From: Peter Rosin @ 2018-10-01 11:49 UTC (permalink / raw)
To: Luca Ceresoli, linux-i2c; +Cc: linux-kernel, Luca Ceresoli
On 2018-09-26 10:35, 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.
Right, looks sane, but can you please also do the same thing for the
ltc4306 and mlxcpld drivers which have the same pattern?
Cheers,
Peter
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>
> Sorry for the RESEND noise, but my provider and vger are not
> interacting (again). I'll solve the issue at its root ASAP, but in the
> meanwhile I'm sending from a different account.
>
> 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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] i2c: mux: pca954x: simplify code to reach the adapter
2018-10-01 11:49 ` Peter Rosin
@ 2018-10-01 20:44 ` Luca Ceresoli
0 siblings, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2018-10-01 20:44 UTC (permalink / raw)
To: Peter Rosin, Luca Ceresoli, linux-i2c; +Cc: linux-kernel
Hi Peter,
thanks for the review.
On 01/10/2018 13:49, Peter Rosin wrote:
> On 2018-09-26 10:35, 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.
>
> Right, looks sane, but can you please also do the same thing for the
> ltc4306 and mlxcpld drivers which have the same pattern?
No problem. But be aware I can't runtime test these two drivers.
--
Luca
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-01 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 8:35 [PATCH RESEND] i2c: mux: pca954x: simplify code to reach the adapter Luca Ceresoli
2018-10-01 11:49 ` Peter Rosin
2018-10-01 20:44 ` Luca Ceresoli
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).