Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1399054pxj; Fri, 21 May 2021 13:17:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys3H2ip65EYj1EfZZq5FuKLgAOTBW2rAk8T5dB8eDFlnW3rSrKyABQYNFnw6wDqKK9MA52 X-Received: by 2002:a05:6e02:c3:: with SMTP id r3mr562425ilq.280.1621628239150; Fri, 21 May 2021 13:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628239; cv=none; d=google.com; s=arc-20160816; b=fWBEuad6pBxuFm5qIcJwRAsibWedXY7e0ozxmM8v/cD92xXJfNoBq3TbYBaHdRu45h Ji7CuI3LI9JEdyKU+soMir67TFlgrag6evO7zbQ+ruRFyxAWkFYKu6izLrsJUESn0/aV XKkzTFyhmdY2wYI4ZXVnN9eFQSl3028ZklZvHSJFwnXcQiWb6kBj78nQ+hcMWpvsGrcE RDOwq8Hv3pjoK1qv3AzQr7IAnnzVuEbJju0fSVshrQbzIn6i5XxcxLR+cwFonyNh3uE5 nJlMXLlCXVi+AyPHmooJKG6g+FVMy30Z3C6lgzJLMdLmzSXp5Jbcnc4Ks0tkDp0okMFv aDyg== 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=hYyazQCV7o9/2ffX8oGQlM25PnfYmuFFZClG9zAHqJc=; b=K/G0XxmAZVl9RJTOiSEtHgEfGYdCMKrWCmJsg6NAO+Rpf+fmhgIhcW7hwg7CF2mYoi LIdCbn2rCq7ervOzveAAJvTL0zfhpUBEIMF0w+DPDa8sUux4XewCqELjTgS3eHoK426J vuelB7gN7mypMIdFM4ZadUUk3vmDUoCee5XOr8bfYQ0NWSgtxN3Ikh7trJfZkHlwlyjP 6O0GVYfGF/xhbtKWebuErn9K9QGCxvB8LdoixgM/4MU4Ap8DPSE0O3LIOHtxUmClYEr2 D4MVaJuXdsHIEFNB47DAYF6vJ0U+UOVOm6iENzjw4nvXownAcl4JUJ3M4GjwBwOb8i71 wE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="j/wmMDvq"; 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 x17si6779686jan.4.2021.05.21.13.17.06; Fri, 21 May 2021 13:17:19 -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="j/wmMDvq"; 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 S236219AbhEUNyM (ORCPT + 99 others); Fri, 21 May 2021 09:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbhEUNyD (ORCPT ); Fri, 21 May 2021 09:54:03 -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 47C03C061763 for ; Fri, 21 May 2021 06:52:40 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id y36so10967159ybi.11 for ; Fri, 21 May 2021 06:52:40 -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=hYyazQCV7o9/2ffX8oGQlM25PnfYmuFFZClG9zAHqJc=; b=j/wmMDvq3difoHoU5SX0tyjbMB5bynTLuxWgfvvtxkWX6KYClGT/XVAMt+3Q221+BW hUBbNCQPDDiVyNNOFrjU/y69OQOzSs1NaBK4JJBul8oUQeBXOJtlD1kCpP6/0QLVyM4Q cLUhO6zRZwgHZ+/SM1SlF0Ab7t9ZusWM/sobTQmE22BaPG9LA1kbUGv6uHwsvL59iO3A t3SzLIAoDbfUGdW9OctPBQ9pVE3QvVDxvFitxOktBTd9NjGiPn0+Y3f9qTa93h8BbxkD xhue1VzAJhcaoSGbx636t1B8FHniYtFHwrfUQliTMKRgi2TZ53L8X7WNs3AtQa4inNmO 6S+w== 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=hYyazQCV7o9/2ffX8oGQlM25PnfYmuFFZClG9zAHqJc=; b=QYFl/TGKHp9xfLj3z5LtDT4rT0RQQzWorPANMYceLY+wKQo1gLdGnt/lr9g3XxGEUC wgJC0YCr9opqBma7DhFD7Qa65OJylRDuTCdXXO1erMmdYjVvvS0iDbhLZvua5Hd4KhcB xdrhUTrjBc5tYoQwBf6mPVhT4maPGhSXWpVf3Vy05xoUxRG2nSCaAsZDBvUdg8NpGob6 szHiQvvxGVuQTOJYP5q9syd/UDyKeCtuJ5cPCzjsr5w3my7jgVgmpO/VXhGBcWJOYYTt q5Fp3KIE0CnSgdeTIYMmRT25ohU28fsAkOitO07Yck5PbLXHA+hmuYYcO0yc1NlQcTTy m1dg== X-Gm-Message-State: AOAM533wKJUtYUiPrwy1Xl1FpAUPDsNZ0jRlYAi4o68l1MYotz3cgxow CnsEZbAYHQCbnMAGIZfmSsWrKila/ho7NZvzBT9EgISF3XFaeEaM X-Received: by 2002:a25:bd04:: with SMTP id f4mr15874966ybk.302.1621605159628; Fri, 21 May 2021 06:52:39 -0700 (PDT) MIME-Version: 1.0 References: <20210514094108.28890-1-aardelean@deviqon.com> In-Reply-To: <20210514094108.28890-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Fri, 21 May 2021 15:52:29 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-tps68470: 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 Fri, May 14, 2021 at 11:41 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. > > Signed-off-by: Alexandru Ardelean > --- > drivers/gpio/gpio-tps68470.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c > index f7f5f770e0fb..423b7bc30ae8 100644 > --- a/drivers/gpio/gpio-tps68470.c > +++ b/drivers/gpio/gpio-tps68470.c > @@ -125,7 +125,6 @@ static const char *tps68470_names[TPS68470_N_GPIO] = { > static int tps68470_gpio_probe(struct platform_device *pdev) > { > struct tps68470_gpio_data *tps68470_gpio; > - int ret; > > tps68470_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps68470_gpio), > GFP_KERNEL); > @@ -146,16 +145,7 @@ static int tps68470_gpio_probe(struct platform_device *pdev) > tps68470_gpio->gc.base = -1; > tps68470_gpio->gc.parent = &pdev->dev; > > - ret = devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, > - tps68470_gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Failed to register gpio_chip: %d\n", ret); > - return ret; > - } > - > - platform_set_drvdata(pdev, tps68470_gpio); > - > - return ret; > + return devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, tps68470_gpio); > } > > static struct platform_driver tps68470_gpio_driver = { > -- > 2.31.1 > Applied. I got confused by the dev_get_drvdata() call earlier in probe but this one's for the parent. Thanks, Bart