Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4418702pxj; Tue, 25 May 2021 07:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw81r416SzlVB4pLcf4bS4/fP3LUQPNeB1hExGGV9QckNCc7Ws1lHg7DdxP8mS7CgMp7/be X-Received: by 2002:a17:907:20d1:: with SMTP id qq17mr28403558ejb.329.1621953391065; Tue, 25 May 2021 07:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621953391; cv=none; d=google.com; s=arc-20160816; b=mQ+BPEkfr9747RQtvtrLJVe6Ii1tQNdQnmuux3XYYJF7uhNnyvsiLp1E6bmyQVWRKu NR5ReiQ33H8LXhv0iB5Ut82UqCxdTLph3oNWl8rpzT4MTNNdbDa951AdUF6SwBTLSiUY Ex0HMkruSSD9TilIi0BULFTahG1ICPd6JWPktCqU0AsGS+3W33hCbrZt28DnX/6Dcz6l ZCA8lYeRyufUtkg9grC8c49gAU5HDW+hgBstgWDKn8EBzhDzZ3xpNw/QKSM6gZbB/GhB LDC9DXOe6kUTeAuZ1+ZOg0w6a1uqtatYuIAYXYC0RgU33Uk484siwC14VKEUaBhzHCLs Bbtw== 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=sh47QlGxynanW52vYTCNZQKEfUAOENA1b1YEoaqVTSk=; b=DNeZx2b6OZ2zTT3g+7/Pn59KCFk50xOOky59ZhRnw5Hiyk+nvR4RLtI95UuFOUQ73P vjUhblV34w625f7g3eOXbTH+k/m3E5r82YYER1gujfFonC5F1q4I3ds+xsHGM76l3Isf d+IImmZUrhsuTcjPbMhq2JqrIK+ZiXc7D1RRGy8WDdp9Czpm+NaGilXKOfPJ9cU/wo33 eN8e7LMButMbEvOFDDTNFh+7eCrTwWDg9SYlkZggrHOjpzLPrtje/f3egd3XisHEieiH hcUm00XQOdAN+K2yUsspJK9NE4NfQwmcub793GNFR7Emd4YxwHFaWyxwyI0vwN4h7rI1 SGGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=sfhJFFb1; 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 n8si14342074edt.540.2021.05.25.07.36.08; Tue, 25 May 2021 07:36:31 -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=sfhJFFb1; 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 S234018AbhEYOgQ (ORCPT + 99 others); Tue, 25 May 2021 10:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234016AbhEYOgL (ORCPT ); Tue, 25 May 2021 10:36:11 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F37C06138A for ; Tue, 25 May 2021 07:34:40 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id z38so13733544ybh.5 for ; Tue, 25 May 2021 07:34: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=sh47QlGxynanW52vYTCNZQKEfUAOENA1b1YEoaqVTSk=; b=sfhJFFb1CG1PY7FfloUbp/iRPdzwOkluLPCH7sflM08U7vFCMLmxB9WgaUO9qz0A1s DyUbS2lcrTkxrlsLH/vIhx6PkHvyWoQ4Ugp0fyDERZB2GQvtAVk7ziMqZMxNba1xeSkw wMikZFv3dmBINzyOOCFfM0AWsIhPiAbwt1uxCb0r/39Ewd7KhSNSRddYBfXll64aheEi MdGXr74F1dIOPL+UXwL75kJLNu9bq1V7eUtCvIFtEdXUJ7fTHziJbm5EatLQWV/RoFcB ehIoMYGn/C91GZqbHtiW/RW2tOsJlq6t/H4xv+6jyyIYtqPzW1oBo1c5BTU8xHgiS1Og ZKLg== 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=sh47QlGxynanW52vYTCNZQKEfUAOENA1b1YEoaqVTSk=; b=Iq5hTZmP8PS2VZodxMFUYnoj2gSepWRHP46UnLHhzZnuGJ/OOTnzmVaPbp5lhznBlT WS4iXw7xcv/bGv2VXMC3ue0RhFYdCQbx88jddGm6GnHr/AZ8snT6HD673UGcX3gtMElP s1SxW5IrlMcA8hcpnOFK2ljWBIFMNPZpE9NUeuqK46swpcteZ5vtELXBvQeLIopAhsQm jwcbrdIpTSE85yBtl/o8a7U9oHr/9tbmcz+QlciVvjff+5DazJ4Pu5nkWJEbR4eTdYjM gUBtpyoIDJznHsNWUrxjAnA1V4XCbd0zL1u115dvK3dXMssv2Jeg4oeBk4SnRpLR7BOL yhXw== X-Gm-Message-State: AOAM533tCVHgC54iab57GbQ27f/wzMzc9pIM/6Ajw2hl0NucvrX5YtJ9 hpveD28m7O1IHjowUbNa2T/tG31yrCel4faWeSuUTA== X-Received: by 2002:a25:8804:: with SMTP id c4mr43679649ybl.469.1621953279543; Tue, 25 May 2021 07:34:39 -0700 (PDT) MIME-Version: 1.0 References: <20210516062629.13550-1-aardelean@deviqon.com> In-Reply-To: <20210516062629.13550-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 25 May 2021 16:34:29 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-sprd: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij , Orson Zhai , Baolin Wang , Lyra Zhang 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 8:26 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-sprd.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c > index 36ea8a3bd451..25c37edcbc6c 100644 > --- a/drivers/gpio/gpio-sprd.c > +++ b/drivers/gpio/gpio-sprd.c > @@ -222,7 +222,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) > { > struct gpio_irq_chip *irq; > struct sprd_gpio *sprd_gpio; > - int ret; > > sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL); > if (!sprd_gpio) > @@ -259,14 +258,7 @@ static int sprd_gpio_probe(struct platform_device *pdev) > irq->num_parents = 1; > irq->parents = &sprd_gpio->irq; > > - ret = devm_gpiochip_add_data(&pdev->dev, &sprd_gpio->chip, sprd_gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Could not register gpiochip %d\n", ret); > - return ret; > - } > - > - platform_set_drvdata(pdev, sprd_gpio); > - return 0; > + return devm_gpiochip_add_data(&pdev->dev, &sprd_gpio->chip, sprd_gpio); > } > > static const struct of_device_id sprd_gpio_of_match[] = { > -- > 2.31.1 > Applied, thanks! Bart