Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3189086pxj; Mon, 24 May 2021 00:22:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa+AUKRTn7kzhUjcxb6U1rCtcdkOLrFqcemHCYW22S1GEy7uRUVDtPtRngZacy4OyJPZbt X-Received: by 2002:a05:6602:2148:: with SMTP id y8mr14632967ioy.208.1621840961259; Mon, 24 May 2021 00:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621840961; cv=none; d=google.com; s=arc-20160816; b=u3DPW8AoiyNIhcBDP/oLU7O6zwB+YmFcF0FDIbycdvD+gQf5+8D51z3lhvPaSfgVYr WbXNBU0W4aC0q86s1KhGGLBGOM2oD9Hpsw3eVrlKq7H+Na3/RVai+DykWnSio9rAEz7n pM+q7mJzhpqGTlfSmzXVFxVM7Id+72EJjsYr+4BWG8POjWvy5ZLZtW0q5VRGGV8pKjly 4+JMi9QA4T5RseyfWpPIWbncJ+EVvbXMYIzYFldFiySu3bV5jh7D0VuHnklZSfjvweXi ndC4+MvwmcC0eJsCyo6HDRX7SrnwvgiTmUk54iiEMHTorkVFhqQA/NYBTuw29qPZKbs4 tkjQ== 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=Q9optjELGGE/yo65RX7aE+4P5JsAxC90Oa22sr1MR3U=; b=DnoKezD65dO1QuGA7xPEtr1U8KqwSAsh1w2SWA1VMrqd2yghuHuonwTQBIoRY5kwT5 NEPgDhOGA6j0duhlGp9yaU+mFaHyhK9tUXth1eaXUnR60LXj4/cNO8VmnixU8Kh+wqQm 5l/6Daa4q1DR1Zsp/W43dpsXD1kXYc5iWUJzghyD92vt+LU6Pv1j25rYaeAjKdUR5cnX J0LMpd+7PTTVifdk5kygZ2/9Lty7qfsGkl3P86qDVBeoBzI/W6fnXSYQ4Rhg76zDp2lj vW5z2ddc1Wgd6lLk6FRNd1wePf8eKb92r5hq3S7Lyw637Zv4lWLYEm7JviZYC8/Wx/gx kJeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=eqjethxm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si14734178iov.75.2021.05.24.00.22.28; Mon, 24 May 2021 00:22:41 -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=@deviqon.com header.s=google header.b=eqjethxm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232339AbhEXHW7 (ORCPT + 99 others); Mon, 24 May 2021 03:22:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbhEXHW7 (ORCPT ); Mon, 24 May 2021 03:22:59 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9AB5C061574 for ; Mon, 24 May 2021 00:21:31 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id s15so13755810vsi.4 for ; Mon, 24 May 2021 00:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q9optjELGGE/yo65RX7aE+4P5JsAxC90Oa22sr1MR3U=; b=eqjethxm3stGXVFYIbqtC/i944yZy5WCk5w5yeOccFG7SpB4oMGJIoyK55+UongDLF Thj7uaOi+gx9oAA23xzNHjx355I/Z8SY8kD385MvXo4/OBDDR0tR4dNd9FX2hQv4iSW9 vEvt8DSMhedO4f34cC5h3XLodL69S+afXSWDBTZ/nMZ4aQqdOdxLjXpTOwR933OQn33H +OjCIM2PqxhhPhBMAXAx+r2cuTep8htw9PuaatuZqvm0FcwVSlYU+eaD89cGL55IiWR1 V1Dr1iO2TbR4I0RlpPH0zPaO9oNLgj+KsBfXt41Vlp9JzrZyrSmiHN18hy7bWdFtleks CSVA== 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=Q9optjELGGE/yo65RX7aE+4P5JsAxC90Oa22sr1MR3U=; b=JV/cBAD9QU32uEU5t6uDuy4oPIXZWvjpJ91iVBv97E3R//K2zslws/0apprJTbvFdr DTSCGK/1yqS6Rhq9pReUcdAvg66uFKFtEOYhlX8FEwly7Kv/IiKjyiUoP8jKTpzW4UbN jYi1XNdHr//7ldyK5ZBgK7kZvJ/QxiNfhxWON3obGZWH7kZ3W29amMB5qIqdSqZ8kqZQ eb6Z/MZHn/+e1NtLrG0FWHLierXvH2MYeER4xrYVToZG7+vN2hvm8x/1PkDyFsnxvbCQ CJISvQp5JLtgwOI4WRAwT0RETe2x+z7e9B+/hkMXhD2cZea6G+mCDa/geZ3ftAFGYdEx OnkA== X-Gm-Message-State: AOAM530ePCUiYY/NqtOJP4yp/RIZazhYr+EDmIjSp6e+L2/Y+ap+TPz5 MY9T//EF4nAJV/ryRKgK8B187VuKQrDaAiFPyp5WKosw8gbwQvdh X-Received: by 2002:a67:7d85:: with SMTP id y127mr19264486vsc.43.1621840890897; Mon, 24 May 2021 00:21:30 -0700 (PDT) MIME-Version: 1.0 References: <20210521181042.7726-1-aardelean@deviqon.com> In-Reply-To: From: Alexandru Ardelean Date: Mon, 24 May 2021 10:21:20 +0300 Message-ID: Subject: Re: [PATCH] gpio: gpio-xgene: simplify probe, return devm_gpiochip_add_data() directly To: Bartosz Golaszewski 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, 23 May 2021 at 21:31, Bartosz Golaszewski wrote: > > On Fri, May 21, 2021 at 8:10 PM Alexandru Ardelean > wrote: > > > > The handling of the return value from devm_gpiochip_add_data() is a bit > > redundant. It prints messages on error and success cases. > > While the success message may be useful, it is more in the area of log > > spam, and these can be printed with other forms of kernel logging. > > > > This change does a direct return with devm_gpiochip_add_data() in the probe > > function. > > > > The platform_set_drvdata() is needed, as this driver uses the stored > > private date in the PM suspend/resume routines. > > > > Signed-off-by: Alexandru Ardelean > > --- > > drivers/gpio/gpio-xgene.c | 11 +---------- > > 1 file changed, 1 insertion(+), 10 deletions(-) > > > > diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c > > index 532b0df8a1f2..fb4b0c67aeef 100644 > > --- a/drivers/gpio/gpio-xgene.c > > +++ b/drivers/gpio/gpio-xgene.c > > @@ -159,7 +159,6 @@ static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); > > static int xgene_gpio_probe(struct platform_device *pdev) > > { > > struct xgene_gpio *gpio; > > - int err = 0; > > > > gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); > > if (!gpio) > > @@ -183,15 +182,7 @@ static int xgene_gpio_probe(struct platform_device *pdev) > > > > platform_set_drvdata(pdev, gpio); > > > > - err = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); > > - if (err) { > > - dev_err(&pdev->dev, > > - "failed to register gpiochip.\n"); > > - return err; > > - } > > - > > - dev_info(&pdev->dev, "X-Gene GPIO driver registered.\n"); > > - return 0; > > + return devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); > > } > > > > static const struct of_device_id xgene_gpio_of_match[] = { > > -- > > 2.31.1 > > > > Applied, thanks. > > For the future: the subject should be: "gpio: xgene: ..." here and > everywhere else. ack will keep that in mind thanks :) Alex > > Bart