Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2376230pja; Thu, 26 Mar 2020 14:13:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vty73sZmq99xCdMjBGLKNjryyAftflWk5NwzjXmEsK2PcwsqBAeajAs2itrWWC9/r0UEwza X-Received: by 2002:a9d:4009:: with SMTP id m9mr7698172ote.132.1585257193382; Thu, 26 Mar 2020 14:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585257193; cv=none; d=google.com; s=arc-20160816; b=Q9+v9vZRycM/ip3/mLJXWJWpthU2yUNih3k7B5f6e+VgMKZis32NwidijsZPMPgOC3 Yo0G78sgom8fc1ND9hEqxEQKXvYZuia11rxJhA/wGLlurWhfnxfZ1YpAmc9aNP68pUXY SEgH0Af77tiEa3cAmKpzEF0Zy5sxkFVaxXgBvk/oxItqSKiIjxbQ9byr/R+5IjNiio82 qOKe4iUMWvurxnrRa4IQkdRqxhNNNvw9rM/nCJmjQi9ymV29la13wxFEaAKVEJCAw1OV 4yQgEJbcOa2CKEQOPbnjj4KWxcif7ovOkK96LMCRBAgqtbvvZa+ncq9EZE9gG+m3F9hF YWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cOOjjm5Jq1pRZeVyA+HyRu/yq+9Yx/Tmnoimao3wC1g=; b=RialVhxZmGkowiE6IlZCj/9IkDDl/0ybX9ETbRCSqiUDFWbBNa0FQtzgTIoJioj+A6 9qmK31wtAHZlXXWc5BSVaJ68V/GM58votK8MxNFg5HKanhRjWCTNGApkKRiV/xcvGQWa 1vIbD3sAVx7bba8E7mP7lGHOHSXl0tswvsUdn39ceSJPgxjTWXdfzXU6M5hwEebXRVaO /CqqYjwSHoe5gMf9GbxwpxhZ3RIc30DGDjzkS76qAyjEq7s+p82jVDRKVSEgpV+r41D0 EJSe181yQ2ARhvUaKeKlVxcSXKsM8YsmEXTRQRjzoaUNonkRxu2LSdiCAgg62MSiHT2p xNPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si1599674otg.84.2020.03.26.14.13.00; Thu, 26 Mar 2020 14:13:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbgCZVKC (ORCPT + 99 others); Thu, 26 Mar 2020 17:10:02 -0400 Received: from sauhun.de ([88.99.104.3]:54332 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727751AbgCZVJz (ORCPT ); Thu, 26 Mar 2020 17:09:55 -0400 Received: from localhost (p54B3331F.dip0.t-ipconnect.de [84.179.51.31]) by pokefinder.org (Postfix) with ESMTPSA id C1D842C1F8A; Thu, 26 Mar 2020 22:09:53 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Andy Shevchenko , Darren Hart , Vadim Pasternak , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] platform/mellanox: mlxreg-hotplug: convert to use i2c_new_client_device() Date: Thu, 26 Mar 2020 22:09:52 +0100 Message-Id: <20200326210952.12857-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200326210952.12857-1-wsa+renesas@sang-engineering.com> References: <20200326210952.12857-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang --- drivers/platform/mellanox/mlxreg-hotplug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 77be37a1fbcf..ed48917af162 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -101,6 +101,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, struct mlxreg_core_data *data) { struct mlxreg_core_hotplug_platform_data *pdata; + struct i2c_client *client; /* Notify user by sending hwmon uevent. */ kobject_uevent(&priv->hwmon->kobj, KOBJ_CHANGE); @@ -121,18 +122,20 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, return -EFAULT; } - data->hpdev.client = i2c_new_device(data->hpdev.adapter, - data->hpdev.brdinfo); - if (!data->hpdev.client) { + client = i2c_new_client_device(data->hpdev.adapter, + data->hpdev.brdinfo); + if (IS_ERR(client)) { dev_err(priv->dev, "Failed to create client %s at bus %d at addr 0x%02x\n", data->hpdev.brdinfo->type, data->hpdev.nr + pdata->shift_nr, data->hpdev.brdinfo->addr); i2c_put_adapter(data->hpdev.adapter); data->hpdev.adapter = NULL; - return -EFAULT; + return PTR_ERR(client); } + data->hpdev.client = client; + return 0; } -- 2.20.1