Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3671126pxj; Mon, 24 May 2021 12:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjEyRGC0xRklhC6WfMO/AWI92sNeg0ppkV9kyQfCwMZMtwBGhGkv6ITZs0uXZ1LVuG6W4P X-Received: by 2002:a05:6602:3427:: with SMTP id n39mr17756055ioz.157.1621882844698; Mon, 24 May 2021 12:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621882844; cv=none; d=google.com; s=arc-20160816; b=O25Hz4UUPOSARZsR3lZpszvDnit8CZjAqIePkXzQeIoNCGHdMcQDTXTOjnlNJ+Ikd3 C68kXWPqckldpYPPzed8JL+w+VL4oR/uA3gbveKJeiEPMB6s45K8ufNOQOEkIMyz2jJt 5iKV5LVhu/pm5OBXkOT9ldvGhv6JgnaTbZMrMHJr7QcwBpHuTpzYS1Echzw4/wqRk56c Z5O+PPOuhGNTcUpVtqIgdHhWKKcIT0BEyzMGxL5a6AZ2wiE8CdVW7aBdWEbKflhYI0If Z8VrmRX8Ncd+mMR/Cjj8xG9eIoy+Qg1Sbt2iKQBtdv/ZLx5v3ZS1xCvcOPOzcV0j9m2H ZcHg== 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=p2E51jDJjGt+nt4Ntdtc54cO0ilON4XWr1Ti/oWq2TA=; b=LuDx5QxzAp8iKPEFdFYDKC930ElNsJ3UWKTQm71P3Me8sI8m1TYMwUIopUMezam4OK Dqc0c03KelW+D4/itdbRjg8uhp2KLs2eVijPpq5yGS1ypc0bCZ0b+ykHRedfbTnIZziA X/pMYEE+6BIduauf7ZY+hsGQy9CIDiTVGy/EbusHTALPnPuUQJBAkJV5pyZnDsSQR832 EDzY13y6j/5Kxis179mMTvuVlvt1croPpCAUb6fd6FuzIOMIsw0ZZkoBEMZJEpBln3+l k2uTm5nZw9UmSDA6VAdd2swdsy44tuCvHQlgMUSJSndVFW86uAhTRUUEhwpXTRt+QLex on+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=mHeJj5KG; 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 d9si14022019ils.122.2021.05.24.12.00.30; Mon, 24 May 2021 12:00:44 -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=mHeJj5KG; 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 S233271AbhEXTBM (ORCPT + 99 others); Mon, 24 May 2021 15:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232709AbhEXTBL (ORCPT ); Mon, 24 May 2021 15:01:11 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3AE0C061756 for ; Mon, 24 May 2021 11:59:42 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id i4so39537596ybe.2 for ; Mon, 24 May 2021 11:59:42 -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=p2E51jDJjGt+nt4Ntdtc54cO0ilON4XWr1Ti/oWq2TA=; b=mHeJj5KGN7eFFLKOTHPmPXvDIoE43xcHxsSx1z40uYjR1885p6SVK9UqPm7N64p2su Uu9F7bDmq+K/4si2yrkDx+DIm9PoHcyZUDfsPBZrarkkzWBOpMppDJXzcWKg9Q5eH0Db ZudFjOoGSGJbWNRl0r6QTsNozT0GA6V4rx4clz6alb4K0vQcjeBMOS9OLa5PowJ6EQch zlgCYER5BFswyWkuWAGS3/PaFzJdgr/B2JiCM0/JwCIwylILNSO4ati142yqyQA9+VpI VcFu0bwoWGuFwJfUoyaxiLTxONx45RyUw2lrDt4JF/FSQ1+ULuAgpOHMjcejI3x1zG8c 1iuQ== 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=p2E51jDJjGt+nt4Ntdtc54cO0ilON4XWr1Ti/oWq2TA=; b=fsHv8fT0DA5AM7/0t+4eIAjaf1qX0rQaZGUFUXrkEybmdT3h82zLp12UqjSkNtMBKM Nki3kUI5ME2/TVClC6ku6I3mEgT01TftNRsDQlypNyt9u8fb+QF3PRWxIA3nb12U/4an o7nYb5bL1CBYaU3AB2JAOUTYRwsF3VtoC2jbCdHvEW89N8LK7nr2xUAoEJ2bgG7uCKBf 6Li2gdjkEv5KsPihswGCcH+w1RIQa3uhdB/Q8D2nVsUh0BfwCKXy8+iBMtNppkgod/tw 4OjFMsGyAZkGjUpZcxBX0Ugcd4oFsU36pLx1kWQn4lQRfUqjWg6FbZag6vztezkfWOzc cWpw== X-Gm-Message-State: AOAM531P+WAhuANtCOeyVReMI/sbOUInEhHWJYM05G6cB0ubzU2+rjZQ hwR1kL4x+YdMqNTYwhwxTsXeKe0U+5dTadgY+T72Ew== X-Received: by 2002:a05:6902:1026:: with SMTP id x6mr34341874ybt.23.1621882781830; Mon, 24 May 2021 11:59:41 -0700 (PDT) MIME-Version: 1.0 References: <20210515075233.7594-1-aardelean@deviqon.com> In-Reply-To: <20210515075233.7594-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Mon, 24 May 2021 20:59:31 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-tps6586x: 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:52 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-tps6586x.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c > index 9b6cc74f47c8..20c4f96f42f0 100644 > --- a/drivers/gpio/gpio-tps6586x.c > +++ b/drivers/gpio/gpio-tps6586x.c > @@ -76,7 +76,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev) > { > struct tps6586x_platform_data *pdata; > struct tps6586x_gpio *tps6586x_gpio; > - int ret; > > pdata = dev_get_platdata(pdev->dev.parent); > tps6586x_gpio = devm_kzalloc(&pdev->dev, > @@ -106,16 +105,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev) > else > tps6586x_gpio->gpio_chip.base = -1; > > - ret = devm_gpiochip_add_data(&pdev->dev, &tps6586x_gpio->gpio_chip, > - tps6586x_gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); > - return ret; > - } > - > - platform_set_drvdata(pdev, tps6586x_gpio); > - > - return ret; > + return devm_gpiochip_add_data(&pdev->dev, &tps6586x_gpio->gpio_chip, tps6586x_gpio); > } > > static struct platform_driver tps6586x_gpio_driver = { > -- > 2.31.1 > Applied, thanks! Bart