Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1070722pxj; Fri, 21 May 2021 05:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPeAACw1TpuaChOZCpEwYIK0tWFj2RDgMGlWCY/R7x6+VcNvaQQHaB6jrDP+iR08Hl1vdf X-Received: by 2002:a17:906:c0c6:: with SMTP id bn6mr9774813ejb.436.1621601737369; Fri, 21 May 2021 05:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621601737; cv=none; d=google.com; s=arc-20160816; b=TK+8El+9cFzzYQr9gxdUMGTz7o9oSUoh4hqs9TbRirvY0ZEWKFJRvrK2nep+lZUqsx sgFR5DRxLCFM6grHXQCNgbuJYxNBy490vuGEnYWYpjzmaNYXthgP4IhXp8msn07RwXKH gLUFGb+sofBXOUb/zco2o+sTo3bo/QVAkFVKA2lvU6kg1zjIdT5+CIlcxmMbiov+k7af NAGrgicGObNEcIG9H1vOSKJxeCaLn+MohxtFoZWmaztz1HB1CcfZprmv7wrs3+71Z8gX WW9GnMAZak79XG2cIypmKSIp5DPATrGZ4RDMmo6lr0/zn6HjgBoYR7v+6NMt4o6WEd2U ABgA== 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=uJtv8tO+srMCLhjCuMBBHQBC6gQTo/DB8dTOrmtQwz0=; b=p5PfEmOhg6fRtNtksjXfuam2J57xT87VnA5QkZ4hBqcIFOll9MZypQhT7k7/7TJz/s BKXNI7WXYvnrbX08RQ6T5x2A/iSPuA1+Kxfx/LeX33D6X6Tdn/WR0IhH1S2jKShx8o2K CZwOQOLcixY66O5BQMez0Tx5lj5zkpguZBo/rlx+8wvQTbqgoX1QcY9rACQQDX7EmZmE +ztZqzYU13TsQxpEVRpWV4+2UyWQAVO/AJn7HtWh3m67oFp8ywwj+xzFVDCT4Q5zsUcN TkThkLuG9n83u10ozFp9M36lMn3fH7hNWHaYvWYTDlI1h2S8nCORHSVJjwAvKRINes20 NbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=u3Q+sm3o; 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 p22si5075677eds.368.2021.05.21.05.55.14; Fri, 21 May 2021 05:55: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=u3Q+sm3o; 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 S234125AbhEUMsA (ORCPT + 99 others); Fri, 21 May 2021 08:48:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbhEUMr6 (ORCPT ); Fri, 21 May 2021 08:47:58 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEA39C061763 for ; Fri, 21 May 2021 05:46:32 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id d14so19356633ybe.3 for ; Fri, 21 May 2021 05:46: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=uJtv8tO+srMCLhjCuMBBHQBC6gQTo/DB8dTOrmtQwz0=; b=u3Q+sm3on6BmPGIfpRvuXdbC9eMKxaBuvgYy1JWnnzsycj2cZfrZU371lePTA11gtu +SE8wjEYS/h6moT8fj80cqELiBU9lIcOjUu7wN1poP1BOvEYLD52cImhNzreVJApnRJZ vXk7Vg5oXpnj/qUiaAThRHYJKPqPnKCtpTsVzsVPSdISWQaTzxIupYxa5U2p9c+9+6QA c9MU/drup9paSSjoteh8IbFJHeOpLLKGCboKFwNUAObbMrxoJiBTL5xWl9eioou7ZmbE XEJuZZsBZzzA/SY7dj8PcotdPEIfLOSA4uxuLMReaUCNlChAvXgK3qEry3bnmfIW4CyC DsGQ== 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=uJtv8tO+srMCLhjCuMBBHQBC6gQTo/DB8dTOrmtQwz0=; b=B7zM+GcLFYo1RSC548/qoyouzOSQEmJcRoGiTk0s2fFHPTuJfzaA2iPmWFPFRbj40G k6243QB0pTEa2lxYaNFkINSsGtlnHLwyWxLYj2BsfE9vU99RNq0PklUNe6o5qy0AeRFq PafTX+U3fG9QSbANlZ/7JxtC1HeGE40e1s8yb5KtKiEmBsk0CnjRnYuoRf6G0lcTL/+w 3ZOsft3UG334XOPRlB+JxIJQtRSZR9Xibku4Wjv/AfDlubLq65mn3iLdfrhaEzVHxWoA Mw7CWLqMlDdjvNd1dWl79wQ2Lx23uJJofZ2KsJKkscW1qGKIzheHy9OL4xOiGNhX3Yhn wbUA== X-Gm-Message-State: AOAM530aJXHO3KNFMauPgya5WReZpgN0QBAA+RTZ/jRsWgswyQxW5oyc DYwdVPq3izcr3Gy6BEh8JU0IoJ7uB1rG0Wv2rAvflQ== X-Received: by 2002:a05:6902:1026:: with SMTP id x6mr13499261ybt.23.1621601191892; Fri, 21 May 2021 05:46:31 -0700 (PDT) MIME-Version: 1.0 References: <20210514092332.19966-1-aardelean@deviqon.com> In-Reply-To: <20210514092332.19966-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Fri, 21 May 2021 14:46:21 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-da9055: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij , Support Opensource Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 11: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-da9055.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c > index 6ad0c37b862e..49446a030f10 100644 > --- a/drivers/gpio/gpio-da9055.c > +++ b/drivers/gpio/gpio-da9055.c > @@ -133,7 +133,6 @@ static int da9055_gpio_probe(struct platform_device *pdev) > { > struct da9055_gpio *gpio; > struct da9055_pdata *pdata; > - int ret; > > gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); > if (!gpio) > @@ -146,15 +145,7 @@ static int da9055_gpio_probe(struct platform_device *pdev) > if (pdata && pdata->gpio_base) > gpio->gp.base = pdata->gpio_base; > > - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gp, 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->gp, gpio); > } > > static struct platform_driver da9055_gpio_driver = { > -- > 2.31.1 > Patch applied, thanks! Bart