Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4418080pxj; Tue, 25 May 2021 07:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3R9C93bcWaRJv7PGMXhibwbHr8dUEd16H4QCTpDmnHBSCGbDZqIeZ9wciT3FqNfRed1Nf X-Received: by 2002:a05:6638:ecf:: with SMTP id q15mr16060999jas.126.1621953342380; Tue, 25 May 2021 07:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621953342; cv=none; d=google.com; s=arc-20160816; b=hEEV/+euYZOtHMKSxqwaXf/+2W/0FeryUBd4qLo44vx9leAEWKx+LzqOjydZDPqXv2 qaAML8DgbtYq9ZBxRwZeAdbX/b5ct/zCkF9Jn/1YRrxcfLaGG3WWiJUAV8z1QXQq9U3D kb+TM2ABtbT1XTygrWt4zMJuHz9O1HISs+RUal3EC5BO31YA7EXVNh79hIsWjX7miHkC obNBDWJouJoyFVD1bv37BntaXPLs5sfiFLM+BhnirdVzgBoss5gf8tThnaCAs1sN/zqL hazCxDBSbyQWr8s+fe7I8igrC4MtB3yrHyXlWBYw43uF8ncSmiYwP8bj1/7pgyyTQkWB sRsw== 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=J87R9tGiD9qctV4x8vijaWhBzZTCCpwwEZSuP/rj7yI=; b=ylzhqcTHG7q9Md+Eu9wSS/ld4wqZAYSdEWlRfhQO94vE0He2ZL0eHQKoLRUdQf0RVb GW9f59rjpdpEcQ+aIhsorAxzPt5l8asX5NZDphxyJQhH9CuOQnMCdP+h+qa/J8MxMRuW XJhT+gJU7Dvv42VUe4vzcaDfCyqWtYFp6W6cRaS58w2VBdI98+O14xkD5QeFvK5W/KRH WPEYF5dbbXzDGxWwQ8bcaYzZrtkBTrGkcugx6lCktZ9xnhaF8kfKn5PgRKTh4ak0w5zC p38RC4+NCPouoav6nUPjshaxNuI9UHmZMUq0J3diHjOAfbf3DSAxd0ofQUa4y4w8FkFA 5IfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=DfjIbrcc; 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 t10si19719101ilf.139.2021.05.25.07.35.25; Tue, 25 May 2021 07:35:42 -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=DfjIbrcc; 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 S234028AbhEYOgJ (ORCPT + 99 others); Tue, 25 May 2021 10:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234026AbhEYOgC (ORCPT ); Tue, 25 May 2021 10:36:02 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16882C06138B for ; Tue, 25 May 2021 07:34:26 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id y197so1624795ybe.11 for ; Tue, 25 May 2021 07:34: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=J87R9tGiD9qctV4x8vijaWhBzZTCCpwwEZSuP/rj7yI=; b=DfjIbrccGsOONpshpqpgyzHXUeXlDTIb7+n07hF3C0K/Apkws/U7vq7MUssKfyYbH4 JW/GkEuWU2SM+e7WQiaS653ngRi3Z/6jrRH2ViGAzBE3WHJwqjsrOgpghCryNo+Xn8Qw Eokvd9R0RPYI5oiOKUp/cB6GPP1IsWJIuVVTF5OoujB/V+BoXVSeEL8dsmjhiUIo4ShC wFMwPVGNicErpOLVuK3ARe9OyR+R0J3aOkaVbMqKNuwKet6OldMiDKoWMVTXE1CQwAQY ZnNhPiFRzBAFPSnS4g06SABRAdYAQ/17sKxg+IRjOJnQbfR0+Y+tvATRlDHPKmWJOQw5 g0ag== 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=J87R9tGiD9qctV4x8vijaWhBzZTCCpwwEZSuP/rj7yI=; b=R4kw7hzOeg2Qy6SzHOEEfEMAC0c+2V05neikOp1pH351Ql/eFXSc15a1ul0X15VZha QipwGC5PfsQ8jhD0I8tL3yBG2ExQj2/+ovpYdZgJis+qtWIEwyiNv5Xog1ABzxOS0uBI KwF9z+siDErVHS3dbuw+IPkEmnBExA2Df4Cul3hJG2RSUz8gQGHtFJfEM9y+Lvzi5qtd T9vAWzHC78uMp2YyYMVxCM38kfacmh7R1oe/3fL+Wz8e0nbL+/rkPc6gw8tAQLQ5SDAb Nl6M8YiszEPlavmkja9gluHzd+aZxIGsId9prw2UYERVD9R2b2TsbsvJqPlNoDPliVZy dP/g== X-Gm-Message-State: AOAM533cmj26r2YNu68wTGMm5Mt/5M7whdMDOZix13Fahh7boI8KGomA u7pkFvJoAxzk+waCT5W5SuLAAZJvqFPjagnkoATJIw== X-Received: by 2002:a25:9d86:: with SMTP id v6mr41609806ybp.366.1621953264969; Tue, 25 May 2021 07:34:24 -0700 (PDT) MIME-Version: 1.0 References: <20210516062315.10832-1-aardelean@deviqon.com> In-Reply-To: <20210516062315.10832-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 25 May 2021 16:34:14 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-sta2x11: 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 8:23 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-sta2x11.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c > index a74bb97a41e2..392fcab06ab8 100644 > --- a/drivers/gpio/gpio-sta2x11.c > +++ b/drivers/gpio/gpio-sta2x11.c > @@ -398,15 +398,7 @@ static int gsta_probe(struct platform_device *dev) > return err; > } > > - err = devm_gpiochip_add_data(&dev->dev, &chip->gpio, chip); > - if (err < 0) { > - dev_err(&dev->dev, "sta2x11 gpio: Can't register (%i)\n", > - -err); > - return err; > - } > - > - platform_set_drvdata(dev, chip); > - return 0; > + return devm_gpiochip_add_data(&dev->dev, &chip->gpio, chip); > } > > static struct platform_driver sta2x11_gpio_platform_driver = { > -- > 2.31.1 > Applied, thanks! Bart