Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2200884ybb; Fri, 27 Mar 2020 00:39:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtJVcADa3GYfXyCHnSH4AZY9TcwJ9PXGVa51xJz81jHbTtXm4GTfz55XOmqpk3ruY03vKkt X-Received: by 2002:aca:5454:: with SMTP id i81mr3170597oib.23.1585294754727; Fri, 27 Mar 2020 00:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585294754; cv=none; d=google.com; s=arc-20160816; b=kmFj562ItBwJYDvLarabiPB2+h7FI6dtMxGdAHVIHvwqDgmXLC/XPviX/pWSJhBr/h qgChsCUPLSXH72QnigMIazwQ0pBDyZxCmqeO2pN+wrbzAuMuY4+yC1OWYArpcWFNKOuK ls2vjTnP64VMzKHRBwWnevjx+0N+e02szK1pPKCop86eGUM7REQjNbe+42jkJkAr3fkH Bm8CVETi/W8+E6He2l4/wMVQbf6qX2XpAgKAtGcB3JtWOg0++5RHMngp8bwpwj1Ej16o hbgFwA59eXyotds8KouD88D1Q6YE+22aonAxpvXHqXYNEwAptVnGaa49mRvaqTA94bN1 DG1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZwyYZHnfmOAxvYE6pXaq6lScZvDjwj92i9ZFKmieB8M=; b=ucwyKs3FnDVua+97AktILxznp4o8aGT0nVvtH1Ly/fBpTaZeR/JgkDEpF/fIb06qdx mmT0f5UyZ0K/ndDwDFzFeZEPzd61UjZ4+5UhWjNwC/baGA0/K7V7NWK4wgGb+bnAklyX LlLvk4w3qwBkKZM//UrH1x/zkeIiU0Q4TQfrKZ9XRBTziX38qYT2nZek/iq8d0Cb1bd9 pDoG44KEVckS7GQbSjNdJtK29Q/gUVvdFmcYUqr5X+ufi0BqnxpxIosWgAN+Rjp33Qqg hmJNo55O2MFg3waWCWvVh12aZcjPVr/z+GGcIIb6C2bTvFO1WHcp/RkSMB4hcXsGbzWP kW/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kw++e9IE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k137si2119829oih.226.2020.03.27.00.39.02; Fri, 27 Mar 2020 00:39:14 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kw++e9IE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbgC0Hie (ORCPT + 99 others); Fri, 27 Mar 2020 03:38:34 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45890 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbgC0Hie (ORCPT ); Fri, 27 Mar 2020 03:38:34 -0400 Received: by mail-pl1-f194.google.com with SMTP id b9so3138453pls.12; Fri, 27 Mar 2020 00:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZwyYZHnfmOAxvYE6pXaq6lScZvDjwj92i9ZFKmieB8M=; b=kw++e9IE5hkHT6/5L4BDR3e8C6yhy5KhquZMhvQsO69OR/XrISu0lOogY4bfWGLhMj hRKBhvEteBMSHdkrw6AMIpRsF+CzXIrESIGpKKKggnoMsMiopc5mM5wsFtD9Ge+yWFaQ XtnZ5EZqxF0oMcwCDuEtuF0PsnpcS/57lsN2RJzYko1rJGyWHFNSZXVtgGTDZMh7CFHr afMEKClx6sHh65bUR0N9D2G7S4XIVobR/9A0qmqhhHQpV9dSvhKfszdVcryONx9+tJ9A hhhlSY25mmQ4H3r892SNXw2PiWRC8s66ijZZ9jU7nm/tzkni686C6JUSRQgqlEd8x9uI C+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZwyYZHnfmOAxvYE6pXaq6lScZvDjwj92i9ZFKmieB8M=; b=Qhv3AFHJrBr3dJcsiQmqk9MqVNesYH5pzoDdXhIu+WbT6YKELR1LzqRDzz7QsJMapL /8jvmCK889ZSwQ3NjqHy5bI7rodFvWtw9mA5AF9cBC0quPlECDQnUPGWsz9WI0Lq9P2I 2cVyEdR1HGDDv7CYqc6VTHur8tCmxMOOJVIN0fOrl6i6ZCDDrInGWk8rLP7x6YOXrnkK iE79dCMasfVQqH02M6bzvs6ajSvqzBErbqWz9+RiKo8ENPFty4x54vyOtv48fB8bEVzb zTLKJgdeBpftHp9R48KKQXHY9oS29OL8vw5w+cENMmCOUoe5p/nDsFfCuLUo15yMMIEn 51Ow== X-Gm-Message-State: ANhLgQ1GJwzcfYDCszes3L+JhOR5Na70VoEkSjz12VyDCAqEr21VoAOV u1jMJ/DZKuoACh6C2wIxoRGu/73HmajEod2w+IIQebXpSKE= X-Received: by 2002:a17:902:5acb:: with SMTP id g11mr4666879plm.18.1585294713210; Fri, 27 Mar 2020 00:38:33 -0700 (PDT) MIME-Version: 1.0 References: <20200326210952.12857-1-wsa+renesas@sang-engineering.com> <20200326210952.12857-3-wsa+renesas@sang-engineering.com> In-Reply-To: <20200326210952.12857-3-wsa+renesas@sang-engineering.com> From: Andy Shevchenko Date: Fri, 27 Mar 2020 09:38:21 +0200 Message-ID: Subject: Re: [PATCH 2/2] platform/mellanox: mlxreg-hotplug: convert to use i2c_new_client_device() To: Wolfram Sang Cc: linux-i2c , Andy Shevchenko , Darren Hart , Vadim Pasternak , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 11:10 PM Wolfram Sang wrote: > > Move away from the deprecated API and return the shiny new ERRPTR where > useful. > Acked-by: Andy Shevchenko > 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 > -- With Best Regards, Andy Shevchenko