Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2617947pxj; Mon, 17 May 2021 06:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0Bqv2cUbsTMYz5yTmd9MaWfNIp/jcjZW0pI5XFRE6YZ5WJlD3VvFvR+PIKCCrFV9w7F1G X-Received: by 2002:a17:906:3949:: with SMTP id g9mr63154569eje.7.1621256497709; Mon, 17 May 2021 06:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621256497; cv=none; d=google.com; s=arc-20160816; b=Gysp3qc4AnjsJhAidL3VcKPM6zUD7I1mEel/J8VoOomSg/8SswfhaY/VZD9oG5+uUp 8D0WopLQySqJH2zyCMlO8jL+ioO7ZiAvV0iZJ3KGSfy3FMx6rc9M7rGTPVzSYrjW4OqH ONKVK2+JzqROTdIPB7I3+C7ZnUJep+uyz8Ow+gNEpjprqOXdmyoAxuBe/cx3kCEeK2Q3 0DoBMw4//9EGl+tRE5mhTSf5NWpIwdypcza6pLXfVnYyNrdvDqYeKGocCmvgAqBoYzrG rwPE+bGehj+aupfukxU6/Ob72ExXbJTbtI3FDhMflBuMybmXqu0oaOdr6REXXBkFTdHN sk5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=/+dR9YYk3RWk64uLzu+4uWYHQg7fQQqahEzyQZJU0nc=; b=FtHcaFo/fy0urig7QarYPcZvsgZvClpRwP1JXvG1+e9L+EfJUU/d+y8Ldc7MrqsPjc /JC0p4AREArBYF1XwzJdHCdagImo723jpNZrHfBJxjZNeYb5zdayVLTQ0aXWBUpFtxk9 V4947KFCoEty0UGw4MaO9hi0P+nvazRnAfTpw2D26h4SVgSx2f4GGc3kshLS0TcGCtBN V288ZFpnSGbz2Lx8/g/5CXYrStxwZO2NI1SLj4twm2vHaRuib1fQpYwycg0xwUut/Yqw ptbqdRz6lPnBnJSsVdFO0rJR+FLVrXuKjkVxgNxo+/ccBSnSTkMw07RKDdoddjUBlxS9 7sKA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si14617489ejp.610.2021.05.17.06.01.13; Mon, 17 May 2021 06:01: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235321AbhEQH5D (ORCPT + 99 others); Mon, 17 May 2021 03:57:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:50789 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235027AbhEQH5D (ORCPT ); Mon, 17 May 2021 03:57:03 -0400 IronPort-SDR: KAMnd1YtSwBbjCYa5z7VdkF8NM+fl1pnSglzntDVif5JELZ7254yqmnhtfcmz8mjgINsFBejOK wigoqYb1xVmg== X-IronPort-AV: E=McAfee;i="6200,9189,9986"; a="200459838" X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="200459838" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 00:55:47 -0700 IronPort-SDR: HnOoOAmNEhEepcKBwbvROy/NWVLdQ0LtDAXMc4EIB22l/Zf0wu2bLkAPhFkuRq4eb4UjrSLh95 KUCERN4XulUA== X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="438794044" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 00:55:45 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1liY6H-00Cgtx-Kj; Mon, 17 May 2021 10:55:41 +0300 Date: Mon, 17 May 2021 10:55:41 +0300 From: Andy Shevchenko To: Alexandru Ardelean Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, andy@kernel.org Subject: Re: [PATCH] gpio: gpio-crystalcove: remove platform_set_drvdata() + cleanup probe Message-ID: References: <20210514093226.22703-1-aardelean@deviqon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210514093226.22703-1-aardelean@deviqon.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 12:32:26PM +0300, 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. Pushed to my review and testing queue, thanks! > Signed-off-by: Alexandru Ardelean > --- > drivers/gpio/gpio-crystalcove.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c > index 2ba225720086..5a909f3c79e8 100644 > --- a/drivers/gpio/gpio-crystalcove.c > +++ b/drivers/gpio/gpio-crystalcove.c > @@ -339,8 +339,6 @@ static int crystalcove_gpio_probe(struct platform_device *pdev) > if (!cg) > return -ENOMEM; > > - platform_set_drvdata(pdev, cg); > - > mutex_init(&cg->buslock); > cg->chip.label = KBUILD_MODNAME; > cg->chip.direction_input = crystalcove_gpio_dir_in; > @@ -372,13 +370,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev) > return retval; > } > > - retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg); > - if (retval) { > - dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval); > - return retval; > - } > - > - return 0; > + return devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg); > } > > static struct platform_driver crystalcove_gpio_driver = { > -- > 2.31.1 > -- With Best Regards, Andy Shevchenko