Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1759890pxj; Sun, 16 May 2021 03:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1GoRzdb20WIoywYAWJIbs04GZLrGHWD94mUK63tsctuekxYnR+pbnBGlct6ARYmHxUKo8 X-Received: by 2002:aa7:d803:: with SMTP id v3mr2057286edq.150.1621160589578; Sun, 16 May 2021 03:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621160589; cv=none; d=google.com; s=arc-20160816; b=kG3IknDA+9zD7E3nexrT7FwbhiF8w+HJFF0KPw/cB2EUM4dsg3Q9bVEh3hg1bdkeyD Fae3a44vK8JJf6jldI/VnV8Iidoal1hwiyRXpcq0qJuq0jhw9jVZ8kw616sSqiEzAATS YFKaC0BneJrhd3j0jJB7PI1nYa7HqWIhrUipBBr8odcJ6vZ/6uoFmdRiwhJMYNQ9V+/H pg185I3WRBrvUyIuSUFApX4ZZ+3HDDY7rVG6GAi+qIpdqLehTdE/+IPOJZk5xTvotVkA HSkPs5PGF0nOpnb3PDTx0D501kUH3K4ZoU2eN0mDJ94DGA74Ecwzg8sRARIpBNgdnCZ4 vQaA== 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=XZuJlEKURtZeYc/J4s/VV0RuP15Zpc+Mo6mw6ORDISM=; b=wPWWPNnAfR9EI+XN1k5m8VQCLxNaKAKf4yajdqK/MYM5nps9E24ZsK8dQijmKlA8q2 M8s272TEAtgnOhBm6wtdU/xSiXIylbbJG6hLSp0tvAlOeBeozRuylpzWK6zq0ZIkLy2o XvHmiPEUyFUUtzHPj1eNC9MSjdzrTZnCHr7oZk9Rwu9jawdqkTtqBOv/ikbX57JjGldw p+HS4N5mmZ94EfltAPDwQH5y3genF2L6KizRuzbo+Xz8oD4PFkXQ9GuLc5Xv6hv8fQK1 kATJJ3CXZooKl00hh2nF6e8IntpVGuX9sjlo/UBn73rtmJ7z6fVQ+hZ8zj+aW1bvRJDl An4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=e8fdGzwQ; 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 js19si14076895ejc.277.2021.05.16.03.22.46; Sun, 16 May 2021 03:23:09 -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=e8fdGzwQ; 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 S233869AbhEPHoc (ORCPT + 99 others); Sun, 16 May 2021 03:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbhEPHob (ORCPT ); Sun, 16 May 2021 03:44:31 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50768C061573 for ; Sun, 16 May 2021 00:43:17 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id s22so4300527ejv.12 for ; Sun, 16 May 2021 00:43:17 -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=XZuJlEKURtZeYc/J4s/VV0RuP15Zpc+Mo6mw6ORDISM=; b=e8fdGzwQKjeF8cC2wH91qxy76ulJvbcMS6oAVyDTtMYGwDlGtDNbZ8D0ScXbumkaJ9 Gd6EBhPWpJo+Qzrym6O392fB2Oz45aZGnDlzBLfGrrTvTh/rT/NhSl7H1V3xoJBT/ive yQifuR02M8QcxYQa/mefzvcd5TnY2ROUAygTO7y4q7RbO9NDWzVFfopCLVCu37wnfQn8 mPriGo5MYyOfJU78K/jTNCrm1spVTnAXkc9TtUVkoYwUovpfkjWakToWBx75l30BUMrq LRzJcSlszOsPwGY7sTczh4xx7Z1AnHx4A270PsfUnMtUj0Nxqh+qonCNXf4UcSClB9IB HR2w== 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=XZuJlEKURtZeYc/J4s/VV0RuP15Zpc+Mo6mw6ORDISM=; b=is5j17rJjOJPwUGicpEJPS/aeSCBsU0mRhftzYc0LrHOntEHadr5YOyZuLEcw+LRKF 1DN4tpUNI+z0RLphXR7YxIMOj462ILllXEWlbr5AFGCPVpGIBrBBQbMEY7AeI+cRsW0G QwrI2fX/Tmyqin7W1nmkPLV+c8PtDCx7a1S/bhirnaLZf9rDqPwOgAtc9d+eZV55Jr5k lcGRFn//5TFs8WEwuwziYWOuBwFbmwx8grw92Aq0UuSb0L7ppiWgeNV/TcP96YsqO5Zi inmko7mc2XEGZR13mf+CB2VAclgYa/V5fZmL+5odru+Jt+DasxMPcAeTYpZ8qsb6csJK MDDw== X-Gm-Message-State: AOAM530xtPXDcjWSQWM3FU32skv3Ovv6GwSmbl1ksCj0Ld+rqecctWuF Im9QCmtIusTkSBMu5rF5YVngww== X-Received: by 2002:a17:906:1997:: with SMTP id g23mr16051490ejd.168.1621150995969; Sun, 16 May 2021 00:43:15 -0700 (PDT) Received: from neptune.. ([188.27.131.122]) by smtp.gmail.com with ESMTPSA id c10sm1180195eds.90.2021.05.16.00.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 00:43:15 -0700 (PDT) From: Alexandru Ardelean To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, Alexandru Ardelean Subject: [PATCH] gpio: gpio-spear-spics: remove platform_set_drvdata() + cleanup probe Date: Sun, 16 May 2021 10:43:11 +0300 Message-Id: <20210516074311.7485-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. This change isn't removing the 'DT probe failed' message, as some may find it useful as a reason for the failed probe. But that can be part of another change if needed. Signed-off-by: Alexandru Ardelean --- drivers/gpio/gpio-spear-spics.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c index 6eca531b7d96..49aac2bb8d2c 100644 --- a/drivers/gpio/gpio-spear-spics.c +++ b/drivers/gpio/gpio-spear-spics.c @@ -122,7 +122,6 @@ static int spics_gpio_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct spear_spics *spics; - int ret; spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL); if (!spics) @@ -148,8 +147,6 @@ static int spics_gpio_probe(struct platform_device *pdev) &spics->cs_enable_shift)) goto err_dt_data; - platform_set_drvdata(pdev, spics); - spics->chip.ngpio = NUM_OF_GPIO; spics->chip.base = -1; spics->chip.request = spics_request; @@ -163,14 +160,7 @@ static int spics_gpio_probe(struct platform_device *pdev) spics->chip.owner = THIS_MODULE; spics->last_off = -1; - ret = devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); - if (ret) { - dev_err(&pdev->dev, "unable to add gpio chip\n"); - return ret; - } - - dev_info(&pdev->dev, "spear spics registered\n"); - return 0; + return devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); err_dt_data: dev_err(&pdev->dev, "DT probe failed\n"); -- 2.31.1