Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1099762pxj; Fri, 21 May 2021 06:31:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6qIhbED1+wJNpCvbvRYSdiBEu0z0pOLJujp6kpoI1l7M1TzM0JLct+/zSOQZyZJtpyQGy X-Received: by 2002:a17:906:d184:: with SMTP id c4mr10322612ejz.83.1621603860071; Fri, 21 May 2021 06:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621603860; cv=none; d=google.com; s=arc-20160816; b=LKhJbxOalc52NK3oVW13LUCQlwHLddaj1M3INWpb5C3Ar5wbsM2mPPnX+4+328sOW2 8M+PuBoK4HBznYi1jgavKXU0fje90agPHAlZ6tk6zgseZhfwM9FKBPQEY+8VI3+dg64j QYI53RzMI4/Iqo1hDgMlK4VweEZ8lAYzlioTTIfsBC1/ggcfDtPIOsrZC9B/HqRMbFDD bEinWTNlDLnE9CT8HTZyITkzTCbDPp6aHo3YjE3smOf3cH4GCkfooUzxTOOeuBw5dKQ2 Lwc3CdcOef2kClXrlDZ1IzHUTC3H/ydLDZpXVoIjSeJm1FxilYr74Izdb0RR6j7v+EHD /Ogg== 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=sBLaqlBTFPOgBNOZr3tcgcclIIzA01Ts0Y/T64t4ZMo=; b=Xe9D9PLk6/JPRWcJpAANQSMmQQA7XolYFqQROZDyTJiFOcGt5YYmRDnnw4rFv9BMoM LwkOCaglcSbWM/5m3MXBLGYBUDAvWAcbKd+MQNJAGfqYE1hYSnWOCjF5CCOyF/dtOMao 0V/r6JKZ4YxgvaQYGDATJCWtAPuxv1N8753L4gaduBT/CwTvFGiJ4vwXNv3t0uMrcnM9 Wwk7uEa2XGoWJb/dJ5osKoQDEkg8O6b8cwp2GD9ZoVqf8c0xE57cxbhZ7vsPMV8sCD7k 2yE/SZu9zp3XN9I4/eTe2OEe3ZOr8GMBmdsJuAVcBPt6UQUdL39muiOKeFP0NZjgkJjT yQZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=WntCVajM; 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 g11si4844710edw.414.2021.05.21.06.30.36; Fri, 21 May 2021 06:31:00 -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=WntCVajM; 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 S235302AbhEUNaa (ORCPT + 99 others); Fri, 21 May 2021 09:30:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235582AbhEUNaY (ORCPT ); Fri, 21 May 2021 09:30:24 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC3DCC061574 for ; Fri, 21 May 2021 06:29:00 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id r8so27442572ybb.9 for ; Fri, 21 May 2021 06:29:00 -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=sBLaqlBTFPOgBNOZr3tcgcclIIzA01Ts0Y/T64t4ZMo=; b=WntCVajMnMxJSVEzbfQNzL+D6cBhgKTk1KsyYUEMEbCGfQiPxblXgCRFUuznbGiIke xYMAbS2KIscS7b20PYzWLbLhMF0NWaroMl0pLuL3yR6ZKsIIRh/gT3mKUHZbBjVykA4V JqJZu4hDXUjsLnGhZGLLGitU+G4oE/kOKaeJdVPdRQG8MxG+WtXxu0lIp0kbSt6n1GKW oRlN3Zor+v9nv8DIuVIPwUvSIk36WPrtFkB832wsxTcNVJeLzb4i5CL0XFL8BzWMeNf9 A3tA02t37TmuGSIyhK1PQeeTYYAKBbMB/RpKFVVle3u88MwXIMinfApV2HF8zSb7TQgG xkbw== 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=sBLaqlBTFPOgBNOZr3tcgcclIIzA01Ts0Y/T64t4ZMo=; b=b3de+dlBzh2048L8NrLTRHfb1YqumkQqXRIoNtbk1XuDRJYMwh1lvKqBAqwuo8DpIC r6Ian7sWHrqDlWVAyhp6wnHfwtO+P80dPsD0UQ82QyYMGzBaEzZtSsR01R+BCZWPKJ57 XlUh87B67ZwIkObYpvuieJUhtSqhvGNERT8mNk2cw7e6zL6hAzUQxWID7ro5QQcb9cMv WzeoC9Pt04e2FEW85Jlz3GsXsjFUyX77jSbEoWzPJGfnFjwcdNtGPMCH+0WFTuwwrTQC q/EzfO9SoWg3R7SzNRDh4qYrcnWCQPzCodztdGXSkJXFYqKX92YnYKamPGQ+fcTMSlJY wnpw== X-Gm-Message-State: AOAM532j6qBrzzxfw0Rkv7cVpPigXTDVlEKhre+kTkoqHP9WPc4GJolk RjpBNrd2uNvPJ+RfFI19/exjytrhELydzYevTt8+zw== X-Received: by 2002:a25:e08e:: with SMTP id x136mr10813650ybg.0.1621603740260; Fri, 21 May 2021 06:29:00 -0700 (PDT) MIME-Version: 1.0 References: <20210514085500.10761-1-aardelean@deviqon.com> In-Reply-To: <20210514085500.10761-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Fri, 21 May 2021 15:28:49 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-visconti: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij , Nobuhiro Iwamatsu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 10:55 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-visconti.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-visconti.c b/drivers/gpio/gpio-visconti.c > index 0e3d19828eb1..47455810bdb9 100644 > --- a/drivers/gpio/gpio-visconti.c > +++ b/drivers/gpio/gpio-visconti.c > @@ -187,15 +187,7 @@ static int visconti_gpio_probe(struct platform_device *pdev) > girq->default_type = IRQ_TYPE_NONE; > girq->handler = handle_level_irq; > > - ret = devm_gpiochip_add_data(dev, &priv->gpio_chip, priv); > - if (ret) { > - dev_err(dev, "failed to add GPIO chip\n"); > - return ret; > - } > - > - platform_set_drvdata(pdev, priv); > - > - return ret; > + return devm_gpiochip_add_data(dev, &priv->gpio_chip, priv); > } > > static const struct of_device_id visconti_gpio_of_match[] = { > -- > 2.31.1 > Applied, thanks! Bartosz