Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2809169pxj; Sun, 23 May 2021 11:32:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHaGa0mQlvnOYHopRddBstG+vSDW8CpmLnpdrnlYLxmAVWTt2eP8gynYaySPg3aLjESPBR X-Received: by 2002:a05:6402:1a:: with SMTP id d26mr4843317edu.105.1621794757136; Sun, 23 May 2021 11:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621794757; cv=none; d=google.com; s=arc-20160816; b=Eg6ZgaGjjefpyhKU1KCXp4d1Xmq1pzUf6s3y38r2gh8IavVb3JlwbgAd9FZRem3Y8T qXMcML3IN4BuWjT/7YwQrnP6rexEI4WoJTCgHq/kcrFmPvXh3ENgKGGFrBVqErk9Y2TK yI4LldYQJd1rCZQmSoSDBnP1Ccvy7TmjGxxgub2RuzYNKnEY2O8NWPwgZGVBmhUeE3dm S1j8T43pQNjblhrj+xhXLUqqvhAEq0ue6CUGp9GRSfTov+siQxbh/FtGlAQ28dI2QxC7 D4QzJ4DQyHsMsiUoe4wi0+6RyakgjV9Ewfg8g51zuzVxhJ1rD17XqtBCsgMC0sPrDC4i tcAg== 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=XoKj2+lP83dFN1Xj+nF6z+/9kXVQORuKRo4UmR66iBQ=; b=gdVFP4zzSv6yA//JfwxxkCNY18ECBWGLX3yhsD9hJf1xDfcH8N6yxpNh2vG0PqpEO1 oKfE85zdFeuCLY4Yu2XKGBucp4a2CaPQF5gtQSo/D5JSyF7Drp+36UZ7SKj9/m6KRwpu 7biYMenpnT7Zcaqv8O+EaYFBJEnMeXrbxjrxUuhZhMqqa567sdY/RUA6mG0IcZWOX1hE jGwTDQYqobzioJnzRrSKt5pJUN1tNNQnfsD5mQJMHWFKkMz3/AIYXpism4shIkDu8Ta1 FFOot5/JcygjXDBg/xYYIN+pj/W33u5zM2urlCzIbvnw5lmU7FrGoYUYQ6zqTZEl8jO9 CSBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=ucAgl6PL; 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 am2si10654917ejc.605.2021.05.23.11.32.13; Sun, 23 May 2021 11:32:37 -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=ucAgl6PL; 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 S231833AbhEWSct (ORCPT + 99 others); Sun, 23 May 2021 14:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231829AbhEWScs (ORCPT ); Sun, 23 May 2021 14:32:48 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAFA7C061574 for ; Sun, 23 May 2021 11:31:21 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id h202so14281288ybg.8 for ; Sun, 23 May 2021 11:31:21 -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=XoKj2+lP83dFN1Xj+nF6z+/9kXVQORuKRo4UmR66iBQ=; b=ucAgl6PLh5+NQYAGsG4hYMtEQSwA12FtTFU4rjsj3BqTUaGKncJxbZvmSscZv16Zig Tv642nWuXX+b8ScXNi4paL9Bd4oLroZ3c7EXIFaBFYApitSDhjuAd1T7xe9j+3WlCD8y 3xr2myRyHc+0l+gV7qk6rSs0hr/GoIaVlTdsKA1Cm0C81SSllDm6QtWezKknSA5QbG97 ntqN+zH5BlaHIj4TonqvgG7Cj/gDOk4F9AQqX21XBuhMMV29fVeRUN73W05GOuBevrJs TTw6c7VtqHg2/gOgUvnZcdBoNaOS2CzbjKFR50BgME77oF9JdL1FmaOPjEnd0RYBODr+ yrgg== 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=XoKj2+lP83dFN1Xj+nF6z+/9kXVQORuKRo4UmR66iBQ=; b=Xcz92ltdHlnrxDeqIfB88fCIdqUSNV9NHl0r5GiRA3za1HKW/Z6vBL32DN/RhPip9k X41YAZit9qjouL0ZY9CTSpkIpwIgR5bU+9Aw/vWNTO1LgAJGHytKcVENsK/wzz6yO51w XExoxrEZMtJrGlClEuO4Q43YTlBX4LgJCMm8+4mSvgqMbfhJSNqNuSBbSK85stvKlGbx v8wZ6lAam0gs07GzZmH4e0yFrj5bOvY/uhEuIxMJ4jCcfTO3t9lE6UY3D+DLiQJTUq2V aUU25DF9Mw5yCng1f8Hbs3iOsxcxaPuqktB45ki3tV/ZGa44nip+oPtkxn33JikMTTQE ugow== X-Gm-Message-State: AOAM533rU97g4ND/lqL1DW1FNzECxoD9ksH4YvSSJuucL5/dnZ4JeH6m 2MX0oYRTelj/m4LSwCgbfn5yBsDswvdKYOpIG7VZVxR1sTg= X-Received: by 2002:a25:9d86:: with SMTP id v6mr28724828ybp.366.1621794680999; Sun, 23 May 2021 11:31:20 -0700 (PDT) MIME-Version: 1.0 References: <20210521181042.7726-1-aardelean@deviqon.com> In-Reply-To: <20210521181042.7726-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Sun, 23 May 2021 20:31:10 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-xgene: simplify probe, return devm_gpiochip_add_data() directly 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 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. Bart