Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1111725pxj; Fri, 21 May 2021 06:46:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGClAR7VAuhIJiK8qZ3g0BtTZMOwzWdcrSmtzoCmerBCtQwmCs3VqxMEBtkpN0HuQpve8T X-Received: by 2002:a17:906:328c:: with SMTP id 12mr10454193ejw.361.1621604790671; Fri, 21 May 2021 06:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621604790; cv=none; d=google.com; s=arc-20160816; b=La6WY4dtdG6bDM7g5cDPoOAEybHbiiLnPDCfpIefWZ/8eyf6YPweVJ/MzsKAWc786p dSew2FTNQZYDYzlHazzJIZ6VhxoByZgnQ+IMzXBEEDjdFgzoPK8eWl+441rwvTcehKnU ctpCcT2BLndeNS87obnfoONrc71NjBNFgvZXYtcEK9NI5Z64EkkNZCxh8T9I5j9aTv+j aoZaVg0UNbTyXuxHeub6u9FCUMxVrH7CvwzQkIF9oE0U51G664XLsb9P9KZKQDDiXOl1 YMQHJEoiCbp9kUlughybnKq4GjjJMBnzjZp3Fq91zO6wcashad4L5hwoCL2hCcZefDdz +OYw== 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=e1Z0ywcEnLesLDpbMsUglm1cxDyFirVMWiC0YS2MSSY=; b=aBjBk0sCEnV4kLti/rYy4ow+u4EaKpgnAlXpoBK7PJNcOQSS0TcNP3lL15B2fAR8WN oL01PZcyoWuvL8Kq0Ec+GjU4hYmF7tPuxBSXz1eiXWbDkoA8o6RFa6CHrJgAQi4oOwoc vYYIY6WHObXLSVOpYdZolMqgB2CRXusE4Re65QF6ZqNNMRFCDjTj5fI7VTHKM4uGzIEb bSakwrrs3G7EVEF5ItmGsqOa/vdizijvm52PK09hJmJZh8sQMNQTMKNdoCam0RHZSe8D L4Dy3sprVWmxVP5BAFNz/QoOQKNTqg5iETSdjqmGmtU6L62sapQZ68neYwx3HPF9BpGL 3uyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MSOE+NCh; 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 v10si5603761eja.616.2021.05.21.06.46.07; Fri, 21 May 2021 06:46:30 -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=MSOE+NCh; 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 S235302AbhEUNpV (ORCPT + 99 others); Fri, 21 May 2021 09:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbhEUNpU (ORCPT ); Fri, 21 May 2021 09:45:20 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6496CC061763 for ; Fri, 21 May 2021 06:43:57 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id f9so27539957ybo.6 for ; Fri, 21 May 2021 06:43:57 -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=e1Z0ywcEnLesLDpbMsUglm1cxDyFirVMWiC0YS2MSSY=; b=MSOE+NChq7kxNkclQJjyDdmo6vpy4A0zAbkj3976n5BijWSPVYyTZdmenDEnyZClZh Gwd0rc16XriieqiVvee0REF2paZz3fHqoRRWkMO59Lpj/cZHiQp8CoKmt74/h3UXYn5b brfe6XnvH69ggPz8HGwkcfTK/ziOoXJAH1UBzVVHCPeUVz79Zzp3XWKpGYMPfDoDTszS nrC2JXyyiC9LrRWx/o7tkdB4zhvZEugW1wXanvM5pQIzhPqHk6PDFBpKnBhj7gIKQLxK IvBXu8tOgJPdqf1TVgrNdvoiuDzwkGUtY9AnFQY7wAwI65xiZu4sno//T7tmfQSffnzo Hc9Q== 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=e1Z0ywcEnLesLDpbMsUglm1cxDyFirVMWiC0YS2MSSY=; b=FNK1iYkXCKt8MyozK//Dwc4qC2mbdqEMhzWaG1w+y68W0egn6hJ2tDsmJIj6y3kxi8 cEhS32LAGGMR3VzDOrhnpmuVMwzR5UZP6X3X6YwT5SSREwP5ctCxwTz72Fzpczc1TJmC 4ANG1XlLKThBmPUvzBidGCDMzG9uDqDuzLAoh4DE4dMq5q7fRzwOh6rVDIqtwCZMPPsL KjydfodjuxjI9Km1mVUch888NkpuodCuj/+2a6fVKS9G2M0TJpErf1MAczPs5TBXm0UI JyZgvm6TIcg1iOSd4RmQIBhp7Q41GxtdZocl6yXXitgtztxTkakqqeOk4Zqu5WQmgwAq NxOA== X-Gm-Message-State: AOAM530XNaDBdbASiC+o0XTvGQX/uMBCcHCDmSUTd/31mxdx7IxSI03q XnB9nz7tlQSup2lkhCvi7L2e27B8HT7jAaTXpEzs2xOkbV+e+UeS X-Received: by 2002:a25:bd04:: with SMTP id f4mr15819498ybk.302.1621604636706; Fri, 21 May 2021 06:43:56 -0700 (PDT) MIME-Version: 1.0 References: <20210514092614.21047-1-aardelean@deviqon.com> In-Reply-To: <20210514092614.21047-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Fri, 21 May 2021 15:43:45 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-bd9571mwv: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij , marek.vasut+renesas@gmail.com 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 11:26 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-bd9571mwv.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c > index df6102b57734..9a4d55f703bb 100644 > --- a/drivers/gpio/gpio-bd9571mwv.c > +++ b/drivers/gpio/gpio-bd9571mwv.c > @@ -97,25 +97,16 @@ static const struct gpio_chip template_chip = { > static int bd9571mwv_gpio_probe(struct platform_device *pdev) > { > struct bd9571mwv_gpio *gpio; > - int ret; > > gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); > if (!gpio) > return -ENOMEM; > > - platform_set_drvdata(pdev, gpio); > - > gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL); > gpio->chip = template_chip; > gpio->chip.parent = pdev->dev.parent; > > - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); > - if (ret < 0) { > - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); > - return ret; > - } > - > - return 0; > + return devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); > } > > static const struct platform_device_id bd9571mwv_gpio_id_table[] = { > -- > 2.31.1 > Applied, thanks! Bartosz