Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4332425pxb; Tue, 31 Aug 2021 02:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP0nLyYfobueS95PESqQ1XeUQVC/dweEctek6pEaUPaMFktyYytemedLWWONdOH12cXc7z X-Received: by 2002:a92:cb4b:: with SMTP id f11mr19727902ilq.189.1630402311866; Tue, 31 Aug 2021 02:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630402311; cv=none; d=google.com; s=arc-20160816; b=upKkZz0PAmGBjVUfOZ8HVbnW57xGHz8K3vo/X+352Ui5ACoXm+vjZui8mH3JbdB07V TLI6ii6sDJMFWpo7ZFHP+tPMp9Im3XoNLKgLN9HZ/xZHjwgTU6wMmOaGNw8BsR5ovSHn MG0SyfD2hxxTtWdpoVr8SYX81ApYr4cLce2qdAGAG9PTzyhV4QcPWVbZWWFzLKvpTxOC te4gZ/D1Vv7pY1XxtWaiY5WycQsRwuOf59NUXuQd1QJRBUWpxhKJYa6atif8z60nbprx HS71IgUeLxCCDCOB78I1QpqdFuvwvsZ9IsCLJw8simPzHLGWZHLQFlhsgLzQBJBKJQvf U6BA== 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=+wJSd/b8R9DZgfIJi5U7BwHEGhO0PaWYM/2wUsKfQ1Y=; b=xAvaCJGwPBK+eaezjAJ5+n0FdGnJ4cJY49+ys+BZgXei88fqH9p2m++7PJoVyjHkb4 fnFfeXhHYg3EwgUVPyJl7oDxOuWZluX9wj2BlMmhnnfWcvLbo1Szy4csOlab7RHBXjhz 7GTYpcIh8KW11C3YkZg/M1q0CEhZY2yprBzn37QT+RhSDQfAEGSQpqAXq6FFhLmIFuRK USf0lMnerCnIS0QB88IqkiARj73OGJjhplzlNDknuAI2AqCCw33ruoLSJDWIB5vprdW4 si+2T8OhUphRVOX95esBSBN4zNj0p9FbIBWK74skQvZ/BNyJz7dl1gNmqeun9Cg3U3BZ 7m+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=hMqfRmcG; 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 b16si15753521ior.73.2021.08.31.02.31.40; Tue, 31 Aug 2021 02:31:51 -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=hMqfRmcG; 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 S240550AbhHaJbC (ORCPT + 99 others); Tue, 31 Aug 2021 05:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240658AbhHaJax (ORCPT ); Tue, 31 Aug 2021 05:30:53 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BCBDC06175F for ; Tue, 31 Aug 2021 02:29:58 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id n126so33592727ybf.6 for ; Tue, 31 Aug 2021 02:29:58 -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=+wJSd/b8R9DZgfIJi5U7BwHEGhO0PaWYM/2wUsKfQ1Y=; b=hMqfRmcGyVFEZgNxjCRVYYeUYAuLBXArcD3MGBBtcFns6zz0uE5jME2WPybkWXRnu0 jrB0cIkqf9knP8+I/dyiLWEBA0ifJKbQcmVVrSEKfj2I6JmhN66YyjsaNPPJ2U9zfT5D hIXxk2jFdnycgWHrEOUtKKY8oE3rpmaAH9luvTDYwHe+tlYNu8hWZfHJW1kjKLSp/V9K iW12rs4yPlYWcmlSNRYM2Hk9cvLzYKhR6tb5FJRFqUXfmi4/RmTZEaBqCepGMPbv2Opd PC1jI6pZ3zi/vtRkIKdNBOGKr8WD40r2gkFvg2fwcsv9QCz7Z/+mkrnviuYgnnfV6gS/ IdCw== 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=+wJSd/b8R9DZgfIJi5U7BwHEGhO0PaWYM/2wUsKfQ1Y=; b=bZ6M1TeQVY1b7aG/bsrjsZM1zt9qnGIUsK5GJwq/Xurr2e5zhcgaW5tXoAXrLIhT88 1FVghn9B4+CY+gzawwvcKQWf50UiS8Fc58ilWyCXaj5QCttazIATnjMJg/sCxYPmWjTq QyQpAbNqda36sheUA8uU+muupWiPCNNYMh2/qLHBfa54PtrR5lruAil2N15XnVC1AYY1 alLE2liaSmOiiVT5s6/iR7GZG+MRJZrdnqNWzbPvT2dI21lT9380ttE1H1aD9xoP0ZvX fUyIj99APW22KCiNV/M+VlG8M1Dl5jxaygOEbusmM8eRJGFWJ3TXjb41uZoMzGtlMBZg 4fJw== X-Gm-Message-State: AOAM531L9xMM7n2X+m5GTyJFRUWxna4SrCxp5xXNxR1J0j28XmpxnUYG m3kjBRTfWmvFsWOJAjfm6Ec7xCL9E5KUFdsYmhUqzQ== X-Received: by 2002:a25:1d07:: with SMTP id d7mr29544339ybd.469.1630402197664; Tue, 31 Aug 2021 02:29:57 -0700 (PDT) MIME-Version: 1.0 References: <20210707135144.191567-1-aardelean@deviqon.com> <20210825070125.32918-1-aardelean@deviqon.com> In-Reply-To: <20210825070125.32918-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 31 Aug 2021 11:29:46 +0200 Message-ID: Subject: Re: [PATCH v2] gpio: viperboard: remove platform_set_drvdata() call in 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 Wed, Aug 25, 2021 at 9:02 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. > > This change removes it. > Also removing with this change is some logging about the failure to init > the gpio chip data. There are other logging methods to view that this > failed. > > Signed-off-by: Alexandru Ardelean > --- > > Changelog v1 -> v2: > * remove dev_err() prints > * [styling] added empty line before first devm_gpiochip_add_data() > > drivers/gpio/gpio-viperboard.c | 14 +++----------- > 1 file changed, 3 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c > index c301c1d56dd2..e55d28a8a66f 100644 > --- a/drivers/gpio/gpio-viperboard.c > +++ b/drivers/gpio/gpio-viperboard.c > @@ -404,11 +404,10 @@ static int vprbrd_gpio_probe(struct platform_device *pdev) > vb_gpio->gpioa.get = vprbrd_gpioa_get; > vb_gpio->gpioa.direction_input = vprbrd_gpioa_direction_input; > vb_gpio->gpioa.direction_output = vprbrd_gpioa_direction_output; > + > ret = devm_gpiochip_add_data(&pdev->dev, &vb_gpio->gpioa, vb_gpio); > - if (ret < 0) { > - dev_err(vb_gpio->gpioa.parent, "could not add gpio a"); > + if (ret < 0) > return ret; > - } > > /* registering gpio b */ > vb_gpio->gpiob.label = "viperboard gpio b"; > @@ -421,15 +420,8 @@ static int vprbrd_gpio_probe(struct platform_device *pdev) > vb_gpio->gpiob.get = vprbrd_gpiob_get; > vb_gpio->gpiob.direction_input = vprbrd_gpiob_direction_input; > vb_gpio->gpiob.direction_output = vprbrd_gpiob_direction_output; > - ret = devm_gpiochip_add_data(&pdev->dev, &vb_gpio->gpiob, vb_gpio); > - if (ret < 0) { > - dev_err(vb_gpio->gpiob.parent, "could not add gpio b"); > - return ret; > - } > - > - platform_set_drvdata(pdev, vb_gpio); > > - return ret; > + return devm_gpiochip_add_data(&pdev->dev, &vb_gpio->gpiob, vb_gpio); > } > > static struct platform_driver vprbrd_gpio_driver = { > -- > 2.31.1 > Applied, thanks! Bart