Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4401172pxv; Tue, 27 Jul 2021 06:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhIe8oHJogYaJPRz4Qe+YsiKu7SPmTbT/ywA3eNVB5ipr4ddkRgfgVGabsu1/+vKDEQ0jY X-Received: by 2002:a02:ccad:: with SMTP id t13mr21586879jap.29.1627392884960; Tue, 27 Jul 2021 06:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627392884; cv=none; d=google.com; s=arc-20160816; b=NcVNr//otdBGpNviKVIeumT8Utc/5PBmdPszxJSMGPktD1sML5y3VW3TM+KOPtCjsG 2jgCc35bxmrJa4+NeUaOa1cpVqHo7fuUn+uUR0A5MyuKhf5e7F6+QXQoUC1F8PUdXuvD zPuxa8KuJNPMBMYtFUt7qR1eyD+IS7ou5X7z8ftMo7WqSKnKj9jX0miy+Do/SuhAP29q 3D5abszLs2VAMa/2x7w0fyo7S6kGcmazZMCmvo2ErksvtpAqXESFyU+lPXTUIr5wHqpa gjLyWzyOLEy4Lm09Y+2blXKFhJIdjwIVxzx3Js27RSj9R0jDeTx9ReW6OQO+6V1g4Oqg 3M/A== 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=OuNLF/hIFVpE5Kuxn2Ih4pguqmnjzDTXsTLZdpYok7M=; b=A/COg1b93235qXIL3AV0BjpnlpjUpxDgpphuv8Cmyt5gpL05rxOcSDmuErKtctu+4r vSPtosCyI13/0YEqMH8VIVEjsvUvmkyoO75wNactZKW5lk7UMNZwpgpatNxZz09x/8xo y2wjUZL1fky27QSrq5pPa0APSINtV81OSK92+lsTIi0wfJKMjAmk+uu3x+Gwk0CelcxW XjLMcHt0ygMkui6RbB1AvyDJiuU3WU1sJj5hlApAJqcvgrl6Wb8KD34z4x5lC6TEDk6a iOyKfxaI0jjYwTv8Z6B9B10yAUg0qilVTl5N74FQ3OTDP02nzlwJFjkh/nGrBEChVxHD ZHsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=JzOwSMnG; 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 n21si3620292jat.63.2021.07.27.06.34.33; Tue, 27 Jul 2021 06:34: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=JzOwSMnG; 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 S232261AbhG0Ncp (ORCPT + 99 others); Tue, 27 Jul 2021 09:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232172AbhG0Nco (ORCPT ); Tue, 27 Jul 2021 09:32:44 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C20C061757 for ; Tue, 27 Jul 2021 06:32:44 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id z18so20672022ybg.8 for ; Tue, 27 Jul 2021 06:32:44 -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=OuNLF/hIFVpE5Kuxn2Ih4pguqmnjzDTXsTLZdpYok7M=; b=JzOwSMnGvT+lU5wWVLjtCZsqfG6nwqN/XBWXhmH7SuwiNtcpGYeG47MaSa4osh5uKE ZERo29MAoUNhPF+JpO5MEdiywCl5dMsAPxAu68g0TlAA1laiQn89k4cFZmkQebzznfsR EMo3qEQ3CGS52+m4i6esXvcfUsz+dZFYmHh5JF+XW0ouK+YPV/eWy4V2vE/ghJ1QtRAD sL54U5rcVkwo+oHyu8wL+SIJ0EFMUxz16hxNVCJt8bj+yyiVPDxzgaHEObNIvg5g8E8I nwfWWPlwDwnZ09earemYPRt8r5c0uu3CuTizVXo9NCKQluAhZ/sKS6dYoC03l1+qwWGH jEXg== 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=OuNLF/hIFVpE5Kuxn2Ih4pguqmnjzDTXsTLZdpYok7M=; b=FnXqMKwJwuGAXKu1ptM+3H1V+nG65LfugJH82ocJiX/H35BY/w4nvgIWWJqqBvWDlr RaiIsRSvmLjvPUB3ouN+7A6sECUvhqTclgjcR98Nt2152Ce9Lt1GyEEg1yKLSEAvd3Nm XnyJSRcdt7XGxCG+qXxhT2k3p9DDXI7moFtSvsRfyuz4GHW9LqSG3neX/HvpJbWQIuXa rwxETc8Y7V0PaerhHYOhQTaMeTv991sfFlh+/D/ZPylzFJlKj+npDy0BKCmbcB8ByZMg mwaap1cewrHEx6aHRfhc/oHWWRFrc8I1t/iY5bz5hyCQq3sktNfyRPUj1s+a9phcomVf 4UMQ== X-Gm-Message-State: AOAM530Fdc6wi0ZpHQAfaDyrmurLWAgPH3W/EIPAFYTs7IjmgtxlmAzq ImFv+XIQv6JhWMoKX0RjhaPzdcTePVqVF10CTXiNKg== X-Received: by 2002:a25:48c7:: with SMTP id v190mr21292996yba.312.1627392763659; Tue, 27 Jul 2021 06:32:43 -0700 (PDT) MIME-Version: 1.0 References: <20210707135144.191567-1-aardelean@deviqon.com> In-Reply-To: From: Bartosz Golaszewski Date: Tue, 27 Jul 2021 15:32:32 +0200 Message-ID: Subject: Re: [PATCH] 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, Jul 21, 2021 at 4:13 PM Alexandru Ardelean wrote: > > On Wed, 21 Jul 2021 at 16:16, Bartosz Golaszewski > wrote: > > > > On Wed, Jul 7, 2021 at 3:51 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. > > > > > > This change removes it. > > > > > > Signed-off-by: Alexandru Ardelean > > > --- > > > drivers/gpio/gpio-viperboard.c | 6 +----- > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > > > diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c > > > index c301c1d56dd2..98ddd6590362 100644 > > > --- a/drivers/gpio/gpio-viperboard.c > > > +++ b/drivers/gpio/gpio-viperboard.c > > > @@ -422,12 +422,8 @@ static int vprbrd_gpio_probe(struct platform_device *pdev) > > > 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) { > > > + if (ret < 0) > > > dev_err(vb_gpio->gpiob.parent, "could not add gpio b"); > > > - return ret; > > > - } > > > - > > > - platform_set_drvdata(pdev, vb_gpio); > > > > > > return ret; > > > } > > > -- > > > 2.31.1 > > > > > > > The log is not really needed, we'll get an error message from gpiolib > > core. Can you remove it while you're at it and just return the result > > of devm_gpiochip_add_data()? > > I thought about removing it, but in this driver there are 2 > devm_gpiochip_add_data() calls. > It registers 2 GPIOchip instances. > Which is not so easy to see in this patch. > > First one says "could not add gpio a" and this one says "could not add gpio b". > I hesitated to remove either of these. > > In this case, it may be a little helpful to know which GPIOchip failed > to be registered. > > But I don't mind removing them both. > Whatever you prefer. I'm undecided. > The core code will still use the label for the error message which says 'a' or 'b' already. I think we can remove it.