Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1107733pxj; Sat, 15 May 2021 04:12:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPVzfJWUzYHoK4Cz3E4oRXII+z0gMINZiPpxJwFXobccesxanHjQBE7bQNsO8Hgsh5RbLz X-Received: by 2002:a92:510:: with SMTP id q16mr31145806ile.41.1621077140776; Sat, 15 May 2021 04:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621077140; cv=none; d=google.com; s=arc-20160816; b=lWQdpKsEJw+9bJXWaS2Xp7E5MeOHzx0zIYAD1JWPJqq31nd13S6hhkZz8JUeGFg5Rc +Zmrt2j/HcuUggVALw5nlfUhxY0AOOzDjpjgdtroZafEySgXTo9NCXd/kTrY+mkvOFJs +p4MFqd8NcIK2d8vqA+0/xRrG74L5TA5E1MTGpfM6tnJh0BR0K7w2CTz6v+MBRSXybUR EU1bpQF9nZLCpvn0RAxcqjRvw05318vOp5uW0jCVIRC9TDeeHyV7TEEGQugFNnptXA1g LTssk8TZ/m59s84x0XrVCki02ba1q056SGZTW4rKTSOKRnKHP5CbHp7Q0yOWCRiQlBce owog== 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=3hNu9kfjNG1tjo/LrCGL5Rnvr9uZgm5fevoZ/tr4zU0=; b=kgxmnV8tNNcxHWZ1PSYYSbe8ya6+CThRG9uIL5/PDPsTiETRruJh6Z6ghSsCDQYzkY pbDPOpeP+xqvI/ZKpS4e6viVx1uBnjWC3YSDaJJj2WHDGmD3nqpcTZX5sliwt0S1utJV 51bQO/tbK8gUqjQp8yZTulTx3S6bc4mYETkjcz7wQWQqik1t33AEjfooCcmwVi0tvtos KfVOE56SV8/mlXC1WDKEfWMsN/UfleYnp3tSN1DwdiqHJk3eKpxANpgjxQeKwWTwvxV2 DisB4w64X9X+a+cJlS2JeM1eD/CG9cBCsFYFsA1fkZKvTRrEaxmtyn0LWjvz2tMCnw0o bU3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b="hf2iN/3x"; 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 t10si2933332ilf.139.2021.05.15.04.12.07; Sat, 15 May 2021 04:12:20 -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="hf2iN/3x"; 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 S233654AbhEOHyT (ORCPT + 99 others); Sat, 15 May 2021 03:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbhEOHyR (ORCPT ); Sat, 15 May 2021 03:54:17 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E3F8C06174A for ; Sat, 15 May 2021 00:53:03 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id s22so1659419ejv.12 for ; Sat, 15 May 2021 00:53:03 -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=3hNu9kfjNG1tjo/LrCGL5Rnvr9uZgm5fevoZ/tr4zU0=; b=hf2iN/3x1+YWUEDcCRLJz6uVPV+WYZ1lTVME58M6+CsrLZi/i0ADLq8Rkk5yOBb/Rr ho9ZzNh/mE+PblHuHjIJSLkxOyNBU6sSgSgyBHi4lb+NUlTxTacpZEFprX43Pf8JsTkw khFqXkeuhQSmNKvNa+oJ4V0VPga3U+0qKB1HWTqdi83FvldSzDme43FlmzQ9dEKJGuOW Zx5inay0JYKUjRm54ET2lg0UjoA4dWNrwDWliyO5sjcZRVWzItGgjvErqlQ7atmhbt5b 92kEw7MYWkQ/4SOSF7TngkTwIonOYMCkl4WgfJe0qpLcMUvyaQ4CuROZuQLgneEQck8F l4qw== 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=3hNu9kfjNG1tjo/LrCGL5Rnvr9uZgm5fevoZ/tr4zU0=; b=MEUq2expvfSW6GfvnqFrfim8Ty3jfg1+f2ZI0kvWkYiSknefg8O2JaA2Pjx9xPGOdp 9Eou+oPbqxNGuxYVmQCVW1Qq0/6di0lIj3jvoJmVc3Sshh9K/SnPMIVJklOjgQ5rtUyu 6LVps+CnF8OkIGS2B941extgepQwTk2DeFji8PRCNeaMDozkRpYBNE5rsbVFCWs+1G02 GDD2FOlw4pJk6D+m2noqRnThsverpb7lBveCsl313XTJa/50BT7/rmFyzew699MYSBNz kSDrbxWEWsINMS7MmHyboTjUvnsyg/ZnXVRLet/GSbQKNO8zV1FyQvuarvh2QyTTu1se CChA== X-Gm-Message-State: AOAM5320uUtToJENnPUEFL9H0Ph3n24apcDI61IHJlka3vN0PKFg2Jk5 MXsNCHzRePwvACjcSYuMZZqJVw== X-Received: by 2002:a17:906:4e0d:: with SMTP id z13mr6474729eju.343.1621065182116; Sat, 15 May 2021 00:53:02 -0700 (PDT) Received: from neptune.. ([188.27.131.122]) by smtp.gmail.com with ESMTPSA id z9sm5969890edb.51.2021.05.15.00.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 May 2021 00:53:01 -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-tps65912: remove platform_set_drvdata() + cleanup probe Date: Sat, 15 May 2021 10:52:57 +0300 Message-Id: <20210515075257.7918-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-tps65912.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c index 510d9ed9fd2a..fab771cb6a87 100644 --- a/drivers/gpio/gpio-tps65912.c +++ b/drivers/gpio/gpio-tps65912.c @@ -99,7 +99,6 @@ static int tps65912_gpio_probe(struct platform_device *pdev) { struct tps65912 *tps = dev_get_drvdata(pdev->dev.parent); struct tps65912_gpio *gpio; - int ret; gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); if (!gpio) @@ -109,16 +108,7 @@ static int tps65912_gpio_probe(struct platform_device *pdev) gpio->gpio_chip = template_chip; gpio->gpio_chip.parent = tps->dev; - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, - 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->gpio_chip, gpio); } static const struct platform_device_id tps65912_gpio_id_table[] = { -- 2.31.1