* [PATCH 0/1] iio: convert to use new I2C API @ 2020-03-26 21:09 Wolfram Sang 2020-03-26 21:09 ` [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() Wolfram Sang 0 siblings, 1 reply; 5+ messages in thread From: Wolfram Sang @ 2020-03-26 21:09 UTC (permalink / raw) To: linux-i2c; +Cc: Wolfram Sang, linux-iio, linux-kernel We are deprecating calls which return NULL in favor of new variants which return an ERR_PTR. Wolfram Sang (1): iio: imu: inv_mpu6050: convert to use i2c_new_client_device() drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.20.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() 2020-03-26 21:09 [PATCH 0/1] iio: convert to use new I2C API Wolfram Sang @ 2020-03-26 21:09 ` Wolfram Sang 2020-03-27 10:52 ` Jean-Baptiste Maneyrol 0 siblings, 1 reply; 5+ messages in thread From: Wolfram Sang @ 2020-03-26 21:09 UTC (permalink / raw) To: linux-i2c Cc: Wolfram Sang, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio, linux-kernel Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c index 2f8560ba4572..c27d06035c8b 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c @@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) st->mux_client = NULL; if (ACPI_HANDLE(&client->dev)) { struct i2c_board_info info; + struct i2c_client *mux_client; struct acpi_device *adev; int ret = -1; @@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) } else return 0; /* no secondary addr, which is OK */ } - st->mux_client = i2c_new_device(st->muxc->adapter[0], &info); - if (!st->mux_client) - return -ENODEV; + mux_client = i2c_new_client_device(st->muxc->adapter[0], &info); + if (IS_ERR(mux_client)) + return PTR_ERR(mux_client); + st->mux_client = mux_client; } return 0; -- 2.20.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() 2020-03-26 21:09 ` [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() Wolfram Sang @ 2020-03-27 10:52 ` Jean-Baptiste Maneyrol 2020-03-28 15:13 ` Jonathan Cameron 0 siblings, 1 reply; 5+ messages in thread From: Jean-Baptiste Maneyrol @ 2020-03-27 10:52 UTC (permalink / raw) To: Wolfram Sang, linux-i2c Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio, linux-kernel Hello, thanks for the patch. Looks good for me. Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Best regards, JB From: linux-iio-owner@vger.kernel.org <linux-iio-owner@vger.kernel.org> on behalf of Wolfram Sang <wsa+renesas@sang-engineering.com> Sent: Thursday, March 26, 2020 22:09 To: linux-i2c@vger.kernel.org <linux-i2c@vger.kernel.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>; Jonathan Cameron <jic23@kernel.org>; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>; linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> Subject: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe. Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c index 2f8560ba4572..c27d06035c8b 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c @@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) st->mux_client = NULL; if (ACPI_HANDLE(&client->dev)) { struct i2c_board_info info; + struct i2c_client *mux_client; struct acpi_device *adev; int ret = -1; @@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) } else return 0; /* no secondary addr, which is OK */ } - st->mux_client = i2c_new_device(st->muxc->adapter[0], &info); - if (!st->mux_client) - return -ENODEV; + mux_client = i2c_new_client_device(st->muxc->adapter[0], &info); + if (IS_ERR(mux_client)) + return PTR_ERR(mux_client); + st->mux_client = mux_client; } return 0; -- 2.20.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() 2020-03-27 10:52 ` Jean-Baptiste Maneyrol @ 2020-03-28 15:13 ` Jonathan Cameron 2020-03-28 19:35 ` Wolfram Sang 0 siblings, 1 reply; 5+ messages in thread From: Jonathan Cameron @ 2020-03-28 15:13 UTC (permalink / raw) To: Jean-Baptiste Maneyrol Cc: Wolfram Sang, linux-i2c, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio, linux-kernel On Fri, 27 Mar 2020 10:52:02 +0000 Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote: > Hello, > > thanks for the patch. > Looks good for me. > > Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Applied to the togreg branch of iio.git and pushed out as testing. Note this has missed the coming merge window. Hope that doesn't matter for your deprecation plans. Thanks, Jonathan > > Best regards, > JB > > > From: linux-iio-owner@vger.kernel.org <linux-iio-owner@vger.kernel.org> on behalf of Wolfram Sang <wsa+renesas@sang-engineering.com> > > Sent: Thursday, March 26, 2020 22:09 > > To: linux-i2c@vger.kernel.org <linux-i2c@vger.kernel.org> > > Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>; Jonathan Cameron <jic23@kernel.org>; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>; linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; > linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> > > Subject: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() > > > > > CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe. > > > > Move away from the deprecated API and return the shiny new ERRPTR where > > useful. > > > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > > --- > > drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c > > index 2f8560ba4572..c27d06035c8b 100644 > > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c > > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c > > @@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) > > st->mux_client = NULL; > > if (ACPI_HANDLE(&client->dev)) { > > struct i2c_board_info info; > > + struct i2c_client *mux_client; > > struct acpi_device *adev; > > int ret = -1; > > > > @@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) > > } else > > return 0; /* no secondary addr, which is OK */ > > } > > - st->mux_client = i2c_new_device(st->muxc->adapter[0], &info); > > - if (!st->mux_client) > > - return -ENODEV; > > + mux_client = i2c_new_client_device(st->muxc->adapter[0], &info); > > + if (IS_ERR(mux_client)) > > + return PTR_ERR(mux_client); > > + st->mux_client = mux_client; > > } > > > > return 0; > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() 2020-03-28 15:13 ` Jonathan Cameron @ 2020-03-28 19:35 ` Wolfram Sang 0 siblings, 0 replies; 5+ messages in thread From: Wolfram Sang @ 2020-03-28 19:35 UTC (permalink / raw) To: Jonathan Cameron Cc: Jean-Baptiste Maneyrol, Wolfram Sang, linux-i2c, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio, linux-kernel [-- Attachment #1: Type: text/plain, Size: 187 bytes --] > Note this has missed the coming merge window. Hope that doesn't matter for your > deprecation plans. No worries. If I can remove it in the cycle after the next, I am happy. Thanks! [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-28 19:35 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-03-26 21:09 [PATCH 0/1] iio: convert to use new I2C API Wolfram Sang 2020-03-26 21:09 ` [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() Wolfram Sang 2020-03-27 10:52 ` Jean-Baptiste Maneyrol 2020-03-28 15:13 ` Jonathan Cameron 2020-03-28 19:35 ` Wolfram Sang
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).