Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp485444pxj; Fri, 14 May 2021 08:13:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyau4hSJJOQqn6Zf4m3Jb/znePyj6pMwDHFSgHm5jRMJxuAOxcHMNqFJhuZ+zKXO5pVz+LH X-Received: by 2002:a5e:8d0a:: with SMTP id m10mr2002617ioj.133.1621005202032; Fri, 14 May 2021 08:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621005202; cv=none; d=google.com; s=arc-20160816; b=kRn7u6THl3CXh9/q4B2wvRMj29G0mV8RV7nyzo8aRM5AYWngZnYFzoKmpcdKImjIEQ MJWuTRHdvmbrGMF6eCSYNdZsWCHX6qrYqnZe+qDkFxAgRJCXRWr7u0nhyzrBRI3nD+sv 35D7jO1TBACxx4PcnkSJnynH8RJGjD8xPNW+BTNX2ALkH8IxF4cD4AV8Apvk1c/R0G3m sC9I1pcXN+FNDgmzw9rJyyq78eniqneZCW0mPVpNzfSyDCDOVbv2HGcxluHI0Qw1MLTS f61hdLZ/0TTRp56GvEq3I7e+GGNYYufUwRnyzj85QjCAPOhdm6Zj6eeSW92qEm8xEcCK ykxw== 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=4oVlIzsgyC0dJxtrYRa2nyFwXTSIbf+GvU9OiEg4J30=; b=TRUf1lpHxEqnGSlZqZNCXWW92uZbpK7akGmBCmv1GmBS8pNUue3+yhjgXJBcDmER/O XjROhDOZzbAyQBOGY2WqCbceKRvJRl0XnjayrJW8hImsMmOi1Qk7un68B7g4HbeQXpCi alBKDJdcYS9BqzinlPHleCnED6SNa8OC2tTYLRIR7FhJa+aCP4s7v+jZxItctPRdjQEv ojO2rNj/s+z9YXqkc/QoNIGrgX4VjNdmcYoxWLhH0TYY4OQfHI5x3M7qfe9yQWTzRFi5 4Y43nNvXsECREeyZp/WZLhqY/5KQ+QGByjvRHYGTNUe61SnbhzS9OdhhTx86JNnWef0Y LRcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=ao7uaInE; 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 n6si8397848ilk.9.2021.05.14.08.13.08; Fri, 14 May 2021 08:13: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=ao7uaInE; 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 S232011AbhENJVs (ORCPT + 99 others); Fri, 14 May 2021 05:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbhENJVr (ORCPT ); Fri, 14 May 2021 05:21:47 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F9BC061574 for ; Fri, 14 May 2021 02:20:35 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id lz27so2405545ejb.11 for ; Fri, 14 May 2021 02:20:35 -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=4oVlIzsgyC0dJxtrYRa2nyFwXTSIbf+GvU9OiEg4J30=; b=ao7uaInE5L1Ppno1CZmlqyzXD553mSlHvsskpnwNHtkvUBX9EYTeprO4GgNNSH3Uji bvrdUs/4JfwAPgKO15aHM/iy7oIfdU0x95VZxMg6nRc6AlvAmtA1oMjbQw6QFa40d2M4 OrlwXHnl30DdcfN2I6fsJdIAO+WcSCtGGMEnaK3tuE5VlJT2JyalJfVIT/p5/mAa7vVf tVJI3BtGQPBRsZ4EF+D5mZIuKg5nh0jcaoCwHOYMZBlzvshZP+wGzS+Zuf/TgsdiG8/V wGNDzyiKZV282kEunh34EvdTIf8jox6RiuBX1w4kIMnx2lxmsAsAUSeQ50yt8gStrQac SFjA== 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=4oVlIzsgyC0dJxtrYRa2nyFwXTSIbf+GvU9OiEg4J30=; b=a2AErOwMWZBbjI0H8fpc5nTcbE0A+R+mj0KxyK2q+hf9mV0ddfvIIiY6W4Yv9rUc4h 69vVTqcSAq+bdS/WEUlc6HOn9ULHyymagvu05//CkcYSzvUNDG9HtwDdvNHe99+CLOJt /nH+Yrjtq1sH19tZhUH68rnfF4zN0kS5GnLp6iZRHXmYPfM0O8yzppABZrAEfmdPfpPU yWr9bQS/NUqTrvH8PrwweDCaF7fxkSzH2Jk2a/qfp/LP7EP5Vu6alzRfvm810eoYQOpP Bm0kHbUroqqZOwCO6Fs2fZkWzTfWZS7Gp22HaQBdFBPNH49CMzXsxLGWLzjb0bARrSzg 0pMA== X-Gm-Message-State: AOAM533Ew/JS2on6JMfSyMFqbNf+tTGboZz5s/F1Oqt2Aoy8HwA/KLHN PdI23awDoo67eEwpdLHuAj9hvsalPGfe8Cvj/Pg= X-Received: by 2002:a17:907:dab:: with SMTP id go43mr5275772ejc.164.1620984034547; Fri, 14 May 2021 02:20:34 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id w21sm4006720edq.82.2021.05.14.02.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 02:20:34 -0700 (PDT) From: Alexandru Ardelean To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, thor.thayer@linux.intel.com, Alexandru Ardelean Subject: [PATCH] gpio: gpio-altera-a10sr: remove platform_set_drvdata() + cleanup probe Date: Fri, 14 May 2021 12:20:17 +0300 Message-Id: <20210514092017.17922-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-altera-a10sr.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-altera-a10sr.c b/drivers/gpio/gpio-altera-a10sr.c index b5917c48e4dc..6af51feda06f 100644 --- a/drivers/gpio/gpio-altera-a10sr.c +++ b/drivers/gpio/gpio-altera-a10sr.c @@ -78,7 +78,6 @@ static const struct gpio_chip altr_a10sr_gc = { static int altr_a10sr_gpio_probe(struct platform_device *pdev) { struct altr_a10sr_gpio *gpio; - int ret; struct altr_a10sr *a10sr = dev_get_drvdata(pdev->dev.parent); gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); @@ -91,15 +90,7 @@ static int altr_a10sr_gpio_probe(struct platform_device *pdev) gpio->gp.parent = pdev->dev.parent; gpio->gp.of_node = pdev->dev.of_node; - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gp, gpio); - if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); - return ret; - } - - platform_set_drvdata(pdev, gpio); - - return 0; + return devm_gpiochip_add_data(&pdev->dev, &gpio->gp, gpio); } static const struct of_device_id altr_a10sr_gpio_of_match[] = { -- 2.31.1