Message ID | 20200107174748.9616-5-wsa+renesas@sang-engineering.com |
---|---|
State | Accepted |
Headers | show |
Series | i2c: convert subsystem to use i2c_new_client_device() | expand |
>>>>> "Wolfram" == Wolfram Sang <wsa+renesas@sang-engineering.com> writes: > Move away from the deprecated API and return the shiny new ERRPTR where > useful. > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> I didn't follow the discussion, but I don't see any returns anywhere? > --- > Build tested only. > drivers/i2c/busses/i2c-ocores.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c > index ca8b3ecfa93d..f5fc75b65a19 100644 > --- a/drivers/i2c/busses/i2c-ocores.c > +++ b/drivers/i2c/busses/i2c-ocores.c > @@ -731,7 +731,7 @@ static int ocores_i2c_probe(struct platform_device *pdev) > /* add in known devices to the bus */ > if (pdata) { > for (i = 0; i < pdata->num_devices; i++) > - i2c_new_device(&i2c->adap, pdata->devices + i); > + i2c_new_client_device(&i2c->adap, pdata->devices + i); > } > return 0; > -- > 2.20.1
Hi Peter, a happy new year to you! > > Move away from the deprecated API and return the shiny new ERRPTR where > > useful. > > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > > I didn't follow the discussion, but I don't see any returns anywhere? Yeah, an ERRPTR is not "useful" here. However, the old API is going to be removed, so your driver is converted, too. Happy hacking, Wolfram
On Tue, Jan 07, 2020 at 07:32:50PM +0100, Peter Korsgaard wrote: > >>>>> "Wolfram" == Wolfram Sang <wsa+renesas@sang-engineering.com> writes: > > > Move away from the deprecated API and return the shiny new ERRPTR where > > useful. > > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > > I didn't follow the discussion, but I don't see any returns anywhere? Hi Peter I have also not been following the discussion. But i2c_new_device() seems to of always returned a NULL pointer on error, and the code has been ignoring it. The 'where useful' comment suggests the return value maybe checked, but it is optional to check it. So this patch seems O.K. I suppose the commit message could be extended with: In this case, the shiny new stuff is not useful, so ignore it. But: Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
>>>>> "Wolfram" == Wolfram Sang <wsa@the-dreams.de> writes: > Hi Peter, > a happy new year to you! thanks, You too! >> > Move away from the deprecated API and return the shiny new ERRPTR where >> > useful. >> >> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> >> >> I didn't follow the discussion, but I don't see any returns anywhere? > Yeah, an ERRPTR is not "useful" here. However, the old API is going to > be removed, so your driver is converted, too. Ok, great. Reviewed-by: Peter Korsgaard <peter@korsgaard.com>
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index ca8b3ecfa93d..f5fc75b65a19 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c @@ -731,7 +731,7 @@ static int ocores_i2c_probe(struct platform_device *pdev) /* add in known devices to the bus */ if (pdata) { for (i = 0; i < pdata->num_devices; i++) - i2c_new_device(&i2c->adap, pdata->devices + i); + i2c_new_client_device(&i2c->adap, pdata->devices + i); } return 0;
Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- Build tested only. drivers/i2c/busses/i2c-ocores.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)