Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3764883pxj; Mon, 24 May 2021 14:27:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjJdv5xaKrelkx6fq4hZ7s3jtTny+95VVbEdjLxD7sSCmsHVMrVBJSgL+wc2aRxMyY8m4P X-Received: by 2002:a17:906:2dca:: with SMTP id h10mr24885250eji.507.1621891667268; Mon, 24 May 2021 14:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621891667; cv=none; d=google.com; s=arc-20160816; b=cad1I9INGoensRPFChpXqmMsIq/2FjoJn2J/arbCSKll6H71zoK2wdVoHzSww1+TT5 pFI1tvjBbo2F09bc5XRctnFEnev4iNSN5qZyw2iQHdzHewYOJ56o+WsjqrbvBCJSDYQZ gYsYPMV6/95NBvPixCYwAsrt50AiqCIvXllYTa3DF/G3Sg1dgoQJW3tk08CL4wgCDd+E 0U9FY/pJZ2eRYar9gF7jvHs2SZFUt/ZguSE5lkDk3Gfj2XSiAFsxjGhz7i79lWHwRQ6m lamY3xZqlIriNkk5WMJDcO22Fhs3CAv9VN6p+E9IZdJ6qQjH2uRAGQRUVEMiRwG5NL/v sTRg== 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=qZ/HHH6RzjFrXIpsOJzjI+Qc1VHUbpxeGOmV9lmhHyc=; b=SuiVdl2gkQANsOdeKFFzBY5FNVLaaWs1oWYLQEPbPAfYo/OBqiD8WK9Kuwh05tKkz3 sT2Ia6idYEOqYhk/6wuob3prb2OVBbf5torOwlgmacbk0+t0UkL3YUko/gDadWCt3LAP ZMEGLm4Ru+JqhPb3mKfonuNEVdqnr6v4IifRi3IRRZyB/aRBIl2cuujJt9Gc3stQeXtR pipCYZgUocpDXWzur4CqvjaH1MzGcZ5VD/GEXOEcyIMgmceaz5KPY/g+KS5heVgghq9D iAf1NRDFMfZ0tQOPvFu9HG6trKP2SwpAcQF/qVkCgYNQtCWqe4k+9ITZ0rIb8dC4mRvR 4CRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=YiUrbTf9; 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 y16si12766131edu.586.2021.05.24.14.27.24; Mon, 24 May 2021 14:27:47 -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=YiUrbTf9; 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 S233316AbhEXTCC (ORCPT + 99 others); Mon, 24 May 2021 15:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbhEXTCB (ORCPT ); Mon, 24 May 2021 15:02:01 -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 50069C061756 for ; Mon, 24 May 2021 12:00:32 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id r8so39449713ybb.9 for ; Mon, 24 May 2021 12:00:32 -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=qZ/HHH6RzjFrXIpsOJzjI+Qc1VHUbpxeGOmV9lmhHyc=; b=YiUrbTf9fHfnrlZaVNXWX2ffeVRP5Psh3XBE1kMs9L/sXhpgKua0laF3KHras/R3fA bNbWe6WXHIATQsWiqoSeIF/HaQSPnkAiwe6vK8M8tFghbUBh/+Y21KsH3Bsgt/5M+nmv mQkPJiwt0yz+D7sDDF6b2svmm40CLw5D5Woj1+iEntXkHFWZt4g/k/y1Wn7+eZVkLySH Qw8DSL08hbOxcctLHINNIb0xFh9fG4UPvaYEZT+x4w56vhkK5hCkYRaowpRkzhAW6GV+ CRVA6ZJu4PY9KVzBdCFlFnpUDwOF3bGa8oQDqzyWxmCBavTGzhYYh002Vnxkw5AWbKt6 R2cA== 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=qZ/HHH6RzjFrXIpsOJzjI+Qc1VHUbpxeGOmV9lmhHyc=; b=YGvfGZNtx0IKaE5gUOFqWVfGCAmysUyzynabQtuy8l8Pk7HrHxX1rA5P6wtDiLdLq0 KDWacYeCNeUe9/VhamBirekKLBhlH44092JfW+TZZayK5tDJWh+Bc6RlQY2DCjNoamUJ 6PhwnAxr8ljgcVgUz9hLr6IniE7Gafjyz9UZDsSRHIzgkKWPU3MhsqgFHgqjamVIiQnR sZOcsz+TD3m3X1oVocnGjjsPMA8F/zl84p+aZk+qFKXqqGPPPWb5SQoGZqkt6fSDgdAz 6d18ctNKOYLQ7poJvA1ZggNsPGGXD7lIG/7jxDBAfUpudds/ESi7TmCfPU0bdLILbSEY 122g== X-Gm-Message-State: AOAM533ROanmTI1NTXT/sV6WLLk5BTEJaI9XAhdC18Vk+Y0M5b2JEGKl ZiDx+mLd4vQ02e6wbcFdaEp1hvX9Sq+30STE4kRE/zy9IwTkeg== X-Received: by 2002:a25:c092:: with SMTP id c140mr2244608ybf.25.1621882831629; Mon, 24 May 2021 12:00:31 -0700 (PDT) MIME-Version: 1.0 References: <20210515075257.7918-1-aardelean@deviqon.com> In-Reply-To: <20210515075257.7918-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Mon, 24 May 2021 21:00:20 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-tps65912: 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 Sat, May 15, 2021 at 9:53 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-tps65912.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c > index 510d9ed9fd2a..fab771cb6a87 100644 > --- a/drivers/gpio/gpio-tps65912.c > +++ b/drivers/gpio/gpio-tps65912.c > @@ -99,7 +99,6 @@ static int tps65912_gpio_probe(struct platform_device *pdev) > { > struct tps65912 *tps = dev_get_drvdata(pdev->dev.parent); > struct tps65912_gpio *gpio; > - int ret; > > gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); > if (!gpio) > @@ -109,16 +108,7 @@ static int tps65912_gpio_probe(struct platform_device *pdev) > gpio->gpio_chip = template_chip; > gpio->gpio_chip.parent = tps->dev; > > - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, > - gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); > - return ret; > - } > - > - platform_set_drvdata(pdev, gpio); > - > - return 0; > + return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, gpio); > } > > static const struct platform_device_id tps65912_gpio_id_table[] = { > -- > 2.31.1 > Applied, thanks! Bart