Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1758597pxj; Sun, 16 May 2021 03:20:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2e5KsyBsXuxmjKXQBDRekvjkrVO2Lu0XmlhxgvNfLOUE7Fy5HXTmmowOc9mzLfs2DyP22 X-Received: by 2002:a17:906:8591:: with SMTP id v17mr5108763ejx.378.1621160422513; Sun, 16 May 2021 03:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621160422; cv=none; d=google.com; s=arc-20160816; b=q5icqjEXzS3Ew1JOQ9F7BYazjp/fP8ELsYJkuKi8+J9vjfkypQR47fL+/jLbL2yvCO fPEvhqUbzAqrErHo65y2dGHOmg2b1MoPZl/izM81X8ZhB6IfrFi1qq5R8Q/qPCF5G/qV 1xtN37ONnC25AL2eElUBRhW37/i5waEU4pIHmGvIz4Miq9v9zPbgrdN4Lf7KnVehxcjG Ccs5z4M+yx2vo5lpS5td+T2AJ08AiRmpdkbnybDLx2wpxv2Nhr+Z2rLbRmwa5wjjM+hy bIZqWmq0yxWdSWI+ZmYAFoj/24G7ZVRr4g4Z0ELWraif4XBCp3VetlWlnl7mn+bu5Egr k0Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KNx8btLvd94ySzWldh8uV9ACMbuH6teV38a5e+QKGTY=; b=jpVyWvCgZ48To4zrjrqI8vl5/Y82OpMirF+1CgasqhqT7c1L8xKRUHr26DYrcfYF2w VUeIZM/id/Csgac9x/5u4iJoMvaGvVvEylLDyJEvhKXnCVZVnNKyDxDMgm0SRnviZ0uG PR+JCFUUmL5C2XQd7VseaaTZ+8aFumCFnFHsy5hsPEwpZiiXwlxvVjLzoFhbIOAtJPBV XUsquD1ldLgsDSEc/X6t0nkYAl4SqjyS6k5+T+xS4inz9tydUjYLELgcTGc1Sg2eDXEu qwc3zIRkLg5cTT8WbJ/4o7iAcVXDRRF5jIwWAP2/U6QjD+9/5X7f5vhm4vbZAlu6kHer 030g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=B3Ir2Ul2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne26si6105771ejc.619.2021.05.16.03.19.58; Sun, 16 May 2021 03:20:22 -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=@deviqon.com header.s=google header.b=B3Ir2Ul2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233327AbhEPG1z (ORCPT + 99 others); Sun, 16 May 2021 02:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbhEPG1y (ORCPT ); Sun, 16 May 2021 02:27:54 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726DAC061573 for ; Sat, 15 May 2021 23:26:40 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id lg14so4366122ejb.9 for ; Sat, 15 May 2021 23:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KNx8btLvd94ySzWldh8uV9ACMbuH6teV38a5e+QKGTY=; b=B3Ir2Ul2SGqG/14tEGYXFNoqMiIHhi2krjwCEuNdj1mdj7glyoAUurD8ot6Va6p9gw fWE02imLqvJMIY/jKcCU/b9aIPGCTcJVGDmQ3M/U0sgC/y+pSHcaNJNX0r8Gi41nGAp/ lcdv4rPncJuanCc7EZvgLdAOyJEvmrhGGaX2tO8lr4f1eP2SFkMPXxG1ULv4AjtdgdmR ws45D9Uy4W8t+0Rs3tExcq+C2tNfcFs7iRdA6aX9XAdN4WTPSabe4vMCn9h9500feWe5 EZ82Gvq61u9RNl0NvgRl5V7vuK5qtuvrP8kMoCxvJuYTK11/aVWWxO1sHZ/qsDmvOMoR KJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KNx8btLvd94ySzWldh8uV9ACMbuH6teV38a5e+QKGTY=; b=XZ1HSSjg1J/YraOeN4FRbdRY7Q5crOKEK85bKtjFxHJuoceRuFL4SEYcc3XbYskofV A5ox5OCtMAM+hZAPb6gRWZLXGXHYJ+Lsofp6A+FNwmtfaN11bllSBt7PvZsRZvnpB1RH kUbG4YIGEJmcUK8Q8RIhjUwSi2sKOOOpB31HQXdh2RIDmzmwQn09ac1DvlKDbq5w8zJX ShLK1qgUJfZ3oZzRgAisHDeQXO3R2JX/xets8SjncoQIRxkRhwNDClUirE37P2tbEfIy GUkwSTh1Y0v2dzxP+vbyOD99foO2mF/oMKGJXv7R7yFH5VEpCrr80yzMQbGUowOaW9yB hHhg== X-Gm-Message-State: AOAM530bOyoFDndiSOV2xOOOG1m9wGL+LzjvUlBt0SrnTGhZ0hptYDg0 hD6Kb7Yo3a86fJHbgOjUvFqNVg== X-Received: by 2002:a17:906:c04b:: with SMTP id bm11mr54940078ejb.263.1621146399103; Sat, 15 May 2021 23:26:39 -0700 (PDT) Received: from neptune.. ([188.27.131.122]) by smtp.gmail.com with ESMTPSA id p7sm138063edw.43.2021.05.15.23.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 May 2021 23:26:38 -0700 (PDT) From: Alexandru Ardelean To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, orsonzhai@gmail.com, baolin.wang7@gmail.com, zhang.lyra@gmail.com, Alexandru Ardelean Subject: [PATCH] gpio: gpio-sprd: remove platform_set_drvdata() + cleanup probe Date: Sun, 16 May 2021 09:26:29 +0300 Message-Id: <20210516062629.13550-1-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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-sprd.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c index 36ea8a3bd451..25c37edcbc6c 100644 --- a/drivers/gpio/gpio-sprd.c +++ b/drivers/gpio/gpio-sprd.c @@ -222,7 +222,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) { struct gpio_irq_chip *irq; struct sprd_gpio *sprd_gpio; - int ret; sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL); if (!sprd_gpio) @@ -259,14 +258,7 @@ static int sprd_gpio_probe(struct platform_device *pdev) irq->num_parents = 1; irq->parents = &sprd_gpio->irq; - ret = devm_gpiochip_add_data(&pdev->dev, &sprd_gpio->chip, sprd_gpio); - if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip %d\n", ret); - return ret; - } - - platform_set_drvdata(pdev, sprd_gpio); - return 0; + return devm_gpiochip_add_data(&pdev->dev, &sprd_gpio->chip, sprd_gpio); } static const struct of_device_id sprd_gpio_of_match[] = { -- 2.31.1