Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4418887pxj; Tue, 25 May 2021 07:36:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLZ9YPtrX+PzmnqLu8igc2FIDAs+eA4WbkYsyFiBnIXHRt5aCuFOSKgHRZeRdVnArklIy2 X-Received: by 2002:a5d:9744:: with SMTP id c4mr21421207ioo.76.1621953405735; Tue, 25 May 2021 07:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621953405; cv=none; d=google.com; s=arc-20160816; b=odnYwPoJqzKBTHxt+ikV2YoeoBRSosS1as0CPxmkldU9dhF4RYuXvYG2fuq3Ma+3+0 5A1sCbQ3S9uJDE/0h8quVIDm6cX94JGOpTyn+zld9lSP9Y7xkEYQffM52kucoWDv1/Ls txhgp+USTdwJrf/2PAmVNBK2FyZoXBRTNTSV3eaHDO47SYH3fQOKXGN/ZXA7rY4dMWfK 4fnQqVfsoA+BXxo9VY7Uu4i+O38KH3+O7NEue3FXw55syqiN++/eBLjeUkwGvPIr75Oq bS29OzNPum+vPzU9yjJ0A3SuegoVkiJ3CfcFQSieOq093/90uJnj9Qf32hYaaZ2Ik869 yevA== 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=ukaK5XhZy2D/ZioTjRK5YPe6DCYHdOPpOGaEW9dEUZ4=; b=EfMYYinRAVD13H2fO8Hr0SQ32jq1N9bI6c+AcPnvW76Jp//tUdq1qvs6HCiDmeh2F4 wCTdlEb0A/CCc2kv8B5oui8RvjPz9F4aXGm+kRq0Gn16CBbZXhpzoCHGQ+FgrxRk323b XolD/i0sgHV9FR9FG69iN8DqlJ+qZ0Rx+bl7bV9ibmS6vKVECkj2wQECOHZTf9F6jYd6 1mA/94xNQYISUyM5XbvW2+Zh9BVtdVGu4Jga12kRPPEwjBg2kGSUzO5ghtgoyN+HlhY0 tzQepF1GDHeOtaPnFN6i4kytHGXbCjzSi07FI557WMTMy18pztobOYnThf6g2K5rgaTL pMjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=JH2fHeK4; 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 c1si15748599jal.96.2021.05.25.07.36.31; Tue, 25 May 2021 07:36:45 -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=JH2fHeK4; 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 S234057AbhEYOhQ (ORCPT + 99 others); Tue, 25 May 2021 10:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbhEYOgf (ORCPT ); Tue, 25 May 2021 10:36:35 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38AC4C061756 for ; Tue, 25 May 2021 07:35:04 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id f9so43338691ybo.6 for ; Tue, 25 May 2021 07:35:04 -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=ukaK5XhZy2D/ZioTjRK5YPe6DCYHdOPpOGaEW9dEUZ4=; b=JH2fHeK4pOIzBfAPJ+ejA4h7tU9NvCfs+WsJ5pMklwU7umE7Kyq6hjjpiQrth8Y/O6 TVat1jFIS90S57SXbaYPu8y/Ue5bEmCj7QZYAOgVxRSCosNkkk1C6D7r6Ndm+w1+68gi ICN5pMFME+Uph8+zOU0m3winfvayDtFHY8gbFkJzv3ztRWL9OBXDD8MvD8hwiaBZNw52 CdadXy430upUpScXFiDcRk9xqDfp3KjF1iR+G7iL+bSVBHtVgFCd2NA7NjRzEKXbiNHV 2iDhYZjmRoCbpG9dpTiGJfZxeRGwD3eVu7JEOnNNMNBleRZYh6Ywi6LXEUL+Ioa1R4RZ m0cg== 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=ukaK5XhZy2D/ZioTjRK5YPe6DCYHdOPpOGaEW9dEUZ4=; b=nCb61Ivqjcvs639N8SeonfpDBU6ZzTEU31grcFc027Mm2xq9Rmmto2ugzygyoe2kBi zI/WkYR2OMFQx8qBXwXPCLQ81toAb1hDq8g7ZQq7mrYVYlM8XsW6nQqmVReunZGiCi84 ccIZ4mI65Q9MfapTneJcZ6nbl3YZPNRPgn3iKbgaU8eycbdRaZfDhyD/L9LnD7wLP1kl uv4597rLzHJqIXaI+cCcn1dGFxbuG8scxHc31oXIxDWTKzb/UwHPnu95ppWtMMuIErf/ S7Vf6VhVXHtPzLFLVxxd5GOJTt71sxSNrcmXr+KfQZiF7mbWQFtu/UHeOjKJ8aPhLPnt Akfw== X-Gm-Message-State: AOAM533fkGvzuGqr3WgCamdQgwye+mB8s9dI6ZOm/nKOHtvEmb5Nn3eM 6J//z/7VTo6E8Sr8+EyU3RQjkEW/BRob5CR1Yn4LmA== X-Received: by 2002:a25:9d86:: with SMTP id v6mr41613992ybp.366.1621953303520; Tue, 25 May 2021 07:35:03 -0700 (PDT) MIME-Version: 1.0 References: <20210517113707.238011-1-aardelean@deviqon.com> In-Reply-To: <20210517113707.238011-1-aardelean@deviqon.com> From: Bartosz Golaszewski Date: Tue, 25 May 2021 16:34:52 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-ath79: remove platform_set_drvdata() + cleanup probe To: Alexandru Ardelean Cc: linux-gpio , LKML , Linus Walleij , Alban Bedel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 1:37 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-ath79.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c > index 678ddd375891..9b780dc5d390 100644 > --- a/drivers/gpio/gpio-ath79.c > +++ b/drivers/gpio/gpio-ath79.c > @@ -234,7 +234,6 @@ static int ath79_gpio_probe(struct platform_device *pdev) > ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); > if (!ctrl) > return -ENOMEM; > - platform_set_drvdata(pdev, ctrl); > > if (np) { > err = of_property_read_u32(np, "ngpios", &ath79_gpio_count); > @@ -290,13 +289,7 @@ static int ath79_gpio_probe(struct platform_device *pdev) > girq->handler = handle_simple_irq; > } > > - err = devm_gpiochip_add_data(dev, &ctrl->gc, ctrl); > - if (err) { > - dev_err(dev, > - "cannot add AR71xx GPIO chip, error=%d", err); > - return err; > - } > - return 0; > + return devm_gpiochip_add_data(dev, &ctrl->gc, ctrl); > } > > static struct platform_driver ath79_gpio_driver = { > -- > 2.31.1 > Applied, thanks! Bart