Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2558799pxj; Mon, 17 May 2021 04:38:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy4+CSkIp/JaDzU0m+05EqjREd8IJNAPseNmJL6/L0CifqiUjJBjYfMQx970EdMv8Cyp8D X-Received: by 2002:a05:6602:229a:: with SMTP id d26mr43827367iod.201.1621251520169; Mon, 17 May 2021 04:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621251520; cv=none; d=google.com; s=arc-20160816; b=QLEVjaI1s+4u2KZZcHvMvScyRptfrG6MNimvlzvD7eo0MYcCp8f72Yp0VFwcn1QQ6Q twkU7a42pDNQb+kFADxPU7NYWqS+9ROJpU/ymk4nXujC+lwNqIYsOxCGwHUSn4bZzUWJ C/SSG5W7nnAe4wBXnngpdu9w3bZYU1HBzzvbm8QDL3CiruOf6ADMRlA5netz3inKSIlP QLdHDB9luTZXyvzS6x30QTR0Ut09r2e3n9XJqCHfywo2eqNRmHDtXX5yBdgBUGR+/TiC ht5m0d/iXqqI0xTWXDrwcYPXSQDTDO0kVDuwtq16enh6iuib0UxDNSC4XkhXampYfEhP f1gQ== 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=4tviugaqYYD/qDQshMzP6z0fQJQ4qs4SDge/5xfu2sQ=; b=syvx0tiyl5JRJoM3daLLNLrlUgLUjemN1Mjbi1pVqyxQTCN8qcUIim48QEa/vt5Zyu diZOHkl/zJdVWzanZqKnjsqyRn91oOxqEqFl5G7YQdGOBvPGubaB49J0Y6IPVzJu5xPy ijW/JADHiyOltSKVlnoT+2XxuDD5ojcPdCGwP61XjlMBFYAi238M3pLTcnqVhuUXjwsE PclQXM7pEdz6TgNIqDx9lGVQ0mt5pmQUR07GdWW4/Y330aP7cQuATIcl2PdYufsVI+Dm 5GEZJQs+RRXDYPhbI12ZSaN2AyWwk+TMQLWvA4Kd+jeC9YknHT13R0E9tni7Ew1JoJOs fl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=R7NOoJLM; 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 a13si18524727ilf.41.2021.05.17.04.38.27; Mon, 17 May 2021 04:38:40 -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=R7NOoJLM; 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 S236849AbhEQLh2 (ORCPT + 99 others); Mon, 17 May 2021 07:37:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236829AbhEQLhX (ORCPT ); Mon, 17 May 2021 07:37:23 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7422AC061756 for ; Mon, 17 May 2021 04:36:06 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id s6so6436134edu.10 for ; Mon, 17 May 2021 04:36:06 -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=4tviugaqYYD/qDQshMzP6z0fQJQ4qs4SDge/5xfu2sQ=; b=R7NOoJLMh5XqQ268Ix/yo1dMCK2Y0qS7nGzpVCyEJsNPth7tB7RQFruRAMJf3MWj/J gOS8C0KxgQ5OjGnJ/SglX69VNSZ7w/1a1mB9nFFcumO1NTaSWasgIULHiJD/pTsmLQ1x MgxszqcgkpgBLvxS/U2etggFjerrD0ahIY4pCzZu2uQYAvpM8G2lH6HAqKn0qhU2Bk5R EU0MeC/W65+5SNsSJds6Wq5w9QKvKrXddvpE+er+wj3VLcvJ/ohzAwCIuC0DyDWRjOeV hJmavNkaDTfugMYAlPEzYgSMg4Wd8the5xj1gEuZybe5fh6A8O1dDsol2FSV8BFmwxtY FOtw== 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=4tviugaqYYD/qDQshMzP6z0fQJQ4qs4SDge/5xfu2sQ=; b=WwlvyG+vd5qYDUbVTeP3TzQAencaT8j+etxtq5meqBcZ8Ry+e1umA6w94YrD0Xqjm5 NNvrzbJqAxM5GGUnu1XXrKtxlwm7Y9aiujMQKbFG9laMtNjeckIu5mnivNhnTqRsRRsN A1UbLvaryrT73gz49g3B4HkF76+eh77Gsbol8VPQHBq+HTuf7U3rJS8wWC4qVO91CZGY cOlxUHIgLxewUnyhYxoKJyfPc9Y0OM3pCWePLhjroKyrZY60049pIAeITkhfWQ0QHYuv HjEN5cq5jHOfarpCyDjUbTUaRaYddRAqb3jLoDqFNf3SyqbgaYTqeLrpe+4qpitFgdUS 6+OA== X-Gm-Message-State: AOAM530/2LrwwJnG9QLlnI0spMAcoBdSlS9w6ObyoxDCAnhIopt6VgK+ 1d11P4Ss47G9scmgC25QIXOJH3WFfPWyDZWnpdQ= X-Received: by 2002:aa7:d491:: with SMTP id b17mr24989029edr.376.1621251364085; Mon, 17 May 2021 04:36:04 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id v24sm2903703eds.19.2021.05.17.04.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 04:36:03 -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-wm831x: remove platform_set_drvdata() + cleanup probe Date: Mon, 17 May 2021 14:35:38 +0300 Message-Id: <20210517113540.237495-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-wm831x.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c index a3a32a77041f..9cf1e5ebb352 100644 --- a/drivers/gpio/gpio-wm831x.c +++ b/drivers/gpio/gpio-wm831x.c @@ -261,7 +261,6 @@ static int wm831x_gpio_probe(struct platform_device *pdev) struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); struct wm831x_pdata *pdata = &wm831x->pdata; struct wm831x_gpio *wm831x_gpio; - int ret; wm831x_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm831x_gpio), GFP_KERNEL); @@ -280,16 +279,7 @@ static int wm831x_gpio_probe(struct platform_device *pdev) wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node; #endif - ret = devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, - wm831x_gpio); - if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); - return ret; - } - - platform_set_drvdata(pdev, wm831x_gpio); - - return ret; + return devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, wm831x_gpio); } static struct platform_driver wm831x_gpio_driver = { -- 2.31.1