Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4420993pxj; Tue, 25 May 2021 07:39:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGy0RHiH6EJyyBs2oqe/F/BURxcWFSQ9S0cRdJ+9/HL3n2gvFaO9dBdZ5fcZI41FxCl6k3 X-Received: by 2002:a05:6e02:581:: with SMTP id c1mr23575634ils.37.1621953576738; Tue, 25 May 2021 07:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621953576; cv=none; d=google.com; s=arc-20160816; b=gfJpQvUMIkutvetnTGubl+v5394ffrVGxXR8Fn5MmssbcFfMky3XTg481259GebiEa 8R4eGKdaEtOHJKDgSMsn5BvO5t/GwWwhj7dGEAtEooIWkb5bLfadOQoJ8WXA/MKr9guL ySjPXI2j2EfNulAtaOE9NgIRckV4xkSDEa/yNpmFKwvhz7QJi4HcPohoHnB9N2ejbi29 4gMETHWgbCCLkQRaK1vm2bZcktiARysUBhdskkuH+pU1ZSMlvs8E1EuU9Lbpn+Zz38aG ByvrMYHwMeNE8M9mL1yjo57+nFb1rc893ngEals5ArZPjvnOnHXpbtkOSQrh09tq5Sy7 XppQ== 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=IXGxhNG8A8CmQe46YV5h/+klPXxUN6g33jr751FeTiA=; b=UcuqJ+77QU2H+sK36Wb47pBWS45jBxM6ew0IUV9jGSv8M+uCsbwkDTbXrkf184GI4k Utwkx5KWhmwTAQ9KBfRoEiGejqjzDCxsxt5bkaxuZkP5yUfC4xfCm6vGkqMRFu6SzkaK rNr5xBsbPj42a7nGEMMLsXLzlHFmnE9wQpNCe0g0OTH/cqE1BezlOgYoRD6EaZarL0WN CiSgVpVTHRCybdpecFLLgBbHrynQ4zhTrJt6Y5gab3FwHVC5G282bujUrRxbSfxsi0/I J72izv8uByT/Wzkl3/i097J+lkdfKnosBKoAUxCP9AhWaqVDf1G+vK40bHBBRLlzGMEv pn6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="jmoBS/7k"; 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 f17si13315032ilc.44.2021.05.25.07.39.22; Tue, 25 May 2021 07:39:36 -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="jmoBS/7k"; 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 S234090AbhEYOhx (ORCPT + 99 others); Tue, 25 May 2021 10:37:53 -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 S234069AbhEYOhT (ORCPT ); Tue, 25 May 2021 10:37:19 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC47C061756 for ; Tue, 25 May 2021 07:35:48 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id y2so43290333ybq.13 for ; Tue, 25 May 2021 07:35:48 -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=IXGxhNG8A8CmQe46YV5h/+klPXxUN6g33jr751FeTiA=; b=jmoBS/7kBDXT9IiemYvkDqOy0ZgH32tzlgl/i3TuYjIajb1hZcuucJhhMoyhSiM2cQ MWAAKbryD8B+pVKbe6c4aAAeZBCoAmTEuN0TH8JDJXW6cqVgJfZbtW+Slqh+5sDes71H saJp/uVoaQobcRYKaESCJwggy6I9LiQ2DnEZwPYlGDLlgBlMGP+AaEvkYxs5PHYSejN4 ArVDvkbJOASU9EISRhLOXGcoBvKkLVkMM8Rk9+GEvyrCQpf/qx1eL97xa5QuIFQfoPuf w5P1QYh/PZjJBl7sX6ytSe9hk4zlwjlvU11CpPYhFI5tVwqOuGfpyU+DfSRwrBV5iYwr e6lw== 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=IXGxhNG8A8CmQe46YV5h/+klPXxUN6g33jr751FeTiA=; b=jJPV/6/UlRgrrkNvB7/qodkviOW+5xHmlUJjvJOEjP0I8Atxj9CsAxyIfWN711hGu3 2nJc7u1cFLEhYofE7O2Whd+2TkwmM0EE886sXA0mxSHm2LIsUa2W6i+J82wpZYjT0NnO zFXzqIeqla1hRWlJZnQk9gM6SfRzTPGt6xyfx+KlE/LhASBjAEwq3mavKC9XT5Jg84nd pqK9GlonwEa/MpGpxKfNSCmQCaQFe4zsH4PZUtRqxitMngqRHj5Tb+f1HxeB8e8CZ3ir etg99BSWs82QZrGw/CB/gAAUHCBT/FwD1rqj4CYM8cmaE9bEZKVmbL+VEs8DhY3/w34h Cvpw== X-Gm-Message-State: AOAM531Zz/bg+Tl+IUy/vuTlaoNE2CunczbwX9cJfuf4p2PrnY2I+zFO g4hY1mTA2VBJWQhuee+COCAfbchKFoyautXwuuoWeQ== X-Received: by 2002:a25:9d86:: with SMTP id v6mr41619044ybp.366.1621953347985; Tue, 25 May 2021 07:35:47 -0700 (PDT) MIME-Version: 1.0 References: <20210516074311.7485-1-aardelean@deviqon.com> In-Reply-To: <20210516074311.7485-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 25 May 2021 16:35:37 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-spear-spics: 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 Sun, May 16, 2021 at 9:43 AM 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. > > This change isn't removing the 'DT probe failed' message, as some may find > it useful as a reason for the failed probe. But that can be part of another > change if needed. > > Signed-off-by: Alexandru Ardelean > --- > drivers/gpio/gpio-spear-spics.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c > index 6eca531b7d96..49aac2bb8d2c 100644 > --- a/drivers/gpio/gpio-spear-spics.c > +++ b/drivers/gpio/gpio-spear-spics.c > @@ -122,7 +122,6 @@ static int spics_gpio_probe(struct platform_device *pdev) > { > struct device_node *np = pdev->dev.of_node; > struct spear_spics *spics; > - int ret; > > spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL); > if (!spics) > @@ -148,8 +147,6 @@ static int spics_gpio_probe(struct platform_device *pdev) > &spics->cs_enable_shift)) > goto err_dt_data; > > - platform_set_drvdata(pdev, spics); > - > spics->chip.ngpio = NUM_OF_GPIO; > spics->chip.base = -1; > spics->chip.request = spics_request; > @@ -163,14 +160,7 @@ static int spics_gpio_probe(struct platform_device *pdev) > spics->chip.owner = THIS_MODULE; > spics->last_off = -1; > > - ret = devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); > - if (ret) { > - dev_err(&pdev->dev, "unable to add gpio chip\n"); > - return ret; > - } > - > - dev_info(&pdev->dev, "spear spics registered\n"); > - return 0; > + return devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); > > err_dt_data: > dev_err(&pdev->dev, "DT probe failed\n"); > -- > 2.31.1 > Applied, thanks! Bart