Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4512281pxj; Tue, 25 May 2021 09:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaQA+50+hNN7dY2FzPIYS+Ro/dQqU7771d5ya1sCVzjoDpan+4+mz8OUTnjJRG/Me3WHnt X-Received: by 2002:a05:6e02:130e:: with SMTP id g14mr24153375ilr.74.1621960619836; Tue, 25 May 2021 09:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621960619; cv=none; d=google.com; s=arc-20160816; b=jF9iRMThbiiuG8gsIjwRyXklSvUbe8pJCJQWuTK1VaHfAgVSezJuFp8zbS6x1ipLXF OKP97K8y8/b+1Lu7o2D4W+L0SF1xb3vKNyb2yjOEZdtPjfnlywsBTGKNyoQt9ZiNZzm2 xiB6tZFPfLx7/wU5PQOcyfw8m4jHkmga5XuXRAcxIn5tXOtVElrJNCCbwN3GAelJ2rAi sPju0gpbyvTIdFT7R/C65TlQrFFHGuBHYnSxKNGQZIGp/O01Uzk0KAzS4oyKM7HasUkG O6phh9YQAAexhBi6HHbBsBmc2qisAWKyT3kuL+rbMlfAPyzscAIOCXu0rv7h5ISc7/II HvLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=J0ilzBZBqgocsd6m3/38+62PwrCky8NxPuNNGb80sqQ=; b=snyrPTKssIrQMYI0n/6sRKY2CnYyf8uEOQIL+qAKDCMUIvjVncCFsQntMqafmGR7sc Vhs1KcoPibLxPpjSC+GCy+T8HmUzqcOZtV/T/Lb3kDCuKiRqSFxyYs+TuESuvhCPd+P4 LpnU3YNXUdNupip5WG8cK9hcy/pRzpFdm6yF64Z+pHy0A5jEk2LKqwNlOVqxjugdZwG6 LqOiZL1t4YOWWhsiHOMhxYQe0a3o0hK9mGEv0QKeAt/MFwOazy09J/VMTC9DSeMMhE6+ QLZW1EmN/lLCFe9HBTGsBs0G/Q4wp3ANx1VjnwqX1vCTvhp+S2cVt9HfgLgYSHNXLS22 imyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=FGvaMn+j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si4161670jag.53.2021.05.25.09.36.45; Tue, 25 May 2021 09:36:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=FGvaMn+j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234093AbhEYOha (ORCPT + 99 others); Tue, 25 May 2021 10:37:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbhEYOhB (ORCPT ); Tue, 25 May 2021 10:37:01 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BADC06138E for ; Tue, 25 May 2021 07:35:26 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id o18so5667638ybc.8 for ; Tue, 25 May 2021 07:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J0ilzBZBqgocsd6m3/38+62PwrCky8NxPuNNGb80sqQ=; b=FGvaMn+jc8e9BOSTKrGpT0ZgugPpAo89cUkcwFeRY9RkLWxf0mK1IZH/IJj7VQuH9a v0iFOADs4WdKtYLfQBwafB6bCoxu0WssKVtgLrmeTUGU2MDhieu4dm8jpmx8+xmqJXRJ uO14ZSo5nKIlfPxpWF4YYIa6ffUcS45cdWUxmrxAOfxjyap+NxiO0blIvyUpuI5FIMSR iLSaHz7BxmK5Q9NUgvFNRmM69rbKtSvFnAVMe6cmyLlxPVb6PFFHUlHg1EDgo+HglrEY /AzFOQaiQPL2njYmntYPE7BXppHF+M3jgmpaZBk3iVxaFEvufp3kS/N6lmC7K99xraml XKiw== 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=J0ilzBZBqgocsd6m3/38+62PwrCky8NxPuNNGb80sqQ=; b=I64m0cdgf4zTZ1CjUQCu6RG15/3TvUScOp6eT93n1zkIzwxG57r0cH9Lf2Be/7OCgA 8vn3EtmI9k2KPRlOO4kkkAO1DyODtrR0OQGAzD1WoazQKdXbKFxYqsN9voJUr0Y/evc2 oSugi2UD/yVhifcVbs2v8jQH0yO9eterAe9wBMMTufAkQ/GH6x8ohv9fOTyGJlK+dJaZ Ln4yvPJPdYA7i/u59U4+mnrw+XKB6nyK3oW8JAOw79ukhPTUwiXbE0Ix7hyfYQeoi6ks eWA6AsDu90LaZpHJWePjz0L03E1UBU30F+/w18hW1iWU2LmqBup4BlH25cNDUEGFaaXG f37Q== X-Gm-Message-State: AOAM5330CqIQIgPo0yXthg1LGB2pFCh5sCDX6ibSUQHKJcTyHXE/CvnW nYhrrmty3GGTuDsFKzr8LrFQ+DtJv1GERiBMXRPtueiqoI83KIY7 X-Received: by 2002:a25:8804:: with SMTP id c4mr43685162ybl.469.1621953326170; Tue, 25 May 2021 07:35:26 -0700 (PDT) MIME-Version: 1.0 References: <20210517113540.237495-1-aardelean@deviqon.com> <20210517113540.237495-2-aardelean@deviqon.com> In-Reply-To: <20210517113540.237495-2-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 25 May 2021 16:35:15 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-wm8350: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 1:36 PM Alexandru Ardelean wrote: > > The platform_set_drvdata() call is only useful if we need to retrieve back > the private information. > Since the driver doesn't do that, it's not useful to have it. > > If this is removed, we can also just do a direct return on > devm_gpiochip_add_data(). We don't need to print that this call failed as > there are other ways to log/see this during probe. > > Signed-off-by: Alexandru Ardelean > --- > drivers/gpio/gpio-wm8350.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c > index 460f0a4b04bd..b1b131fb9804 100644 > --- a/drivers/gpio/gpio-wm8350.c > +++ b/drivers/gpio/gpio-wm8350.c > @@ -105,7 +105,6 @@ static int wm8350_gpio_probe(struct platform_device *pdev) > struct wm8350 *wm8350 = dev_get_drvdata(pdev->dev.parent); > struct wm8350_platform_data *pdata = dev_get_platdata(wm8350->dev); > struct wm8350_gpio_data *wm8350_gpio; > - int ret; > > wm8350_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8350_gpio), > GFP_KERNEL); > @@ -121,16 +120,7 @@ static int wm8350_gpio_probe(struct platform_device *pdev) > else > wm8350_gpio->gpio_chip.base = -1; > > - ret = devm_gpiochip_add_data(&pdev->dev, &wm8350_gpio->gpio_chip, > - wm8350_gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); > - return ret; > - } > - > - platform_set_drvdata(pdev, wm8350_gpio); > - > - return ret; > + return devm_gpiochip_add_data(&pdev->dev, &wm8350_gpio->gpio_chip, wm8350_gpio); > } > > static struct platform_driver wm8350_gpio_driver = { > -- > 2.31.1 > Applied, thanks! Bart