From patchwork Thu Mar 26 21:09:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 11461211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C0FF13A4 for ; Thu, 26 Mar 2020 21:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 776B62078E for ; Thu, 26 Mar 2020 21:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727879AbgCZVMN (ORCPT ); Thu, 26 Mar 2020 17:12:13 -0400 Received: from sauhun.de ([88.99.104.3]:54372 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbgCZVJ7 (ORCPT ); Thu, 26 Mar 2020 17:09:59 -0400 Received: from localhost (p54B3331F.dip0.t-ipconnect.de [84.179.51.31]) by pokefinder.org (Postfix) with ESMTPSA id 8B2B82C1F87; Thu, 26 Mar 2020 22:09:57 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device() Date: Thu, 26 Mar 2020 22:09:55 +0100 Message-Id: <20200326210955.12991-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200326210955.12991-1-wsa+renesas@sang-engineering.com> References: <20200326210955.12991-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Wolfram Sang --- 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;