Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2810267pxj; Sun, 23 May 2021 11:35:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw3oqUAq4mMxSkYAP27QUUnOeu0XD8uA3eTmr/w81dunZkh3cWFYnTP+ot4AE6fF7G0aLd X-Received: by 2002:a92:360e:: with SMTP id d14mr11416201ila.106.1621794907081; Sun, 23 May 2021 11:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621794907; cv=none; d=google.com; s=arc-20160816; b=JigavDund/vTm0tJiWac8gw97xdL128fWacoZnbdSQ6MnF+x/RZ42vDJ8ctjpJCgOn xSsiGGFeBSzmbmvjK574CciTXPyph+zdANeyPfCyF4LneKmcKH1iZo9BFZehVA9TDEi6 jy8XUGJuxR/B429F+uRLJtEfV6A1AbN3TM7omd0wKaaPDjnIMGAi45TDyttZGzxbq/tI 0/h+Ices2vU4kWlpYgIEDjdKXXbTWl9j6k9ihjJHNDUHBq3M8afbNNp8ZrWWzCbI3wu6 xiVJiyKVEh8bpsIWzC8iarUQZx+7A7Q/TQxtBU3NomHmNfb65+MfC657/llkjQ7yHKka nWhA== 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=MrBKPkLd0GPEoJRc/y1IxZTBQ7SxwLafLOfLA+MVi4Y=; b=P5amfgkz/sxJCpwhGnOYhStnUcmVcUvw7IBml0SO29YblZKIRnRcCB6zxQiQ+lI8WD U+8/uRtk6kjSEH8UMX4luQvtUHhOKurQlM/IRUEc45JJFrxuQ+TuaFtrmNJn8dzSLGRL XuvHlxAhsGteGCRzXt4RwcY1N5sgw1aD+tkREl4QRJPE5pQMYLA4NSBN6sttr06MlFa1 v/cBoMA0sjKHfo2czjDt39PUy7uEEMDlAYkOC3V51gs8cRcqHs7FO1uiZq++wQ0n7EZp ZJ1nJlRojAdSOZXeMiefm18kNr2d+/CGFqJ/xOHg8biyxFKpEYfH6maFhzZJSjkJDC70 bsmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=kvlo+cd5; 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 l17si12154354jaj.81.2021.05.23.11.34.53; Sun, 23 May 2021 11:35:07 -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=kvlo+cd5; 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 S231829AbhEWSeH (ORCPT + 99 others); Sun, 23 May 2021 14:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbhEWSeH (ORCPT ); Sun, 23 May 2021 14:34:07 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AD8C061574 for ; Sun, 23 May 2021 11:32:40 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id r7so12828998ybs.10 for ; Sun, 23 May 2021 11:32:40 -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=MrBKPkLd0GPEoJRc/y1IxZTBQ7SxwLafLOfLA+MVi4Y=; b=kvlo+cd5IVnaI9LZz/ljNfjHmPfQ27rucW8tNNag0/3T7j8dWVifg7+g7Z440XXUJF QHNmO0wZexx6WDanF/JoubAwMWgjMhtkExAjiDmqP9+es6WHmw+GZmTf48C/i9P/xt1F tbNfnj/mj5qL0Jwyxw56IZrCeYUYiVGvLvzsBlYsi4r3EPIQ2Rci1x3lq9GKIZIREq5i Ne7GBDS+kdDrBBF0SZT6mdVRZeZPxJMy9kJHuQGQA5J+01ueR3nfl/KJjwDOBFgIriRu Y/tyhFnwW6vQ9gQ2X4jXoSG25/jwhngWYP9SJ7XDBcMzKzZ4eUnuE5921D0nZxNlUieO lfHw== 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=MrBKPkLd0GPEoJRc/y1IxZTBQ7SxwLafLOfLA+MVi4Y=; b=nIAFzB1Gy/w6aPnT4dxz1nZTxqKUgE4gwFxvNb5oJRaZDrmc3a5mw5xVyBX37l+4sT NGbXpPnxy9r7assLw+VWe3TRmQPV46U59uqgr7rXY8kWQRVicVoRZQWFTgX0Z+bfsTmI JD41w6X75k3d1pLNrYmynyjTBJ/UudjJPb+0l/njTsi9wUDg/iFbgXNUpXW2o0HWkQnE 8/VAm8dkJx1MKA9dv9NuRFskpeenVVUWiDpJ0F12TQ9B1qr7tBTMgUShxlwzrRDydS0O Tu5ywI/wc79YjLTKNujYw0IMbSr/HvqcRyMH9VxbpIq85a4K6TGRmqe8FOokZ8SE3QTw owog== X-Gm-Message-State: AOAM530Re48MHOx5696D3JTmP7y+MrtgDrofrn1kSDuqIZ5V6lqIdtvJ 93oVYAvcXmDGqTCFPQ6E2qgII2p2Zoawu/4KVKZbSQ== X-Received: by 2002:a25:287:: with SMTP id 129mr29266156ybc.312.1621794759679; Sun, 23 May 2021 11:32:39 -0700 (PDT) MIME-Version: 1.0 References: <20210521181355.9983-1-aardelean@deviqon.com> In-Reply-To: <20210521181355.9983-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Sun, 23 May 2021 20:32:28 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-da9052: 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 21, 2021 at 8:14 PM 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-da9052.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c > index 9aa59afdcbbf..559188d80c2b 100644 > --- a/drivers/gpio/gpio-da9052.c > +++ b/drivers/gpio/gpio-da9052.c > @@ -196,7 +196,6 @@ static int da9052_gpio_probe(struct platform_device *pdev) > { > struct da9052_gpio *gpio; > struct da9052_pdata *pdata; > - int ret; > > gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); > if (!gpio) > @@ -209,15 +208,7 @@ static int da9052_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 da9052_gpio_driver = { > -- > 2.31.1 > Applied, thanks! Bart