Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1413329pxj; Fri, 21 May 2021 13:42:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUUMfdN/85kehN8UN3S8bPiby/OLDfPZw7cUSRBpHnKxWAJBANPHn75U0MTR9fKzt2jMAQ X-Received: by 2002:a02:bb98:: with SMTP id g24mr7273273jan.19.1621629731930; Fri, 21 May 2021 13:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621629731; cv=none; d=google.com; s=arc-20160816; b=jEJxPLgoW6NE6vcGiW1/Unryfez2rWH7tdDnl4tNCKbdwu2na0amP1bshwYjJb2G3Z LRj1bOTlr1PFbxWJdhJTIzwbPV6ZjoYxKqBeaAuEMXqZrjBmLLrW0Z4ZhypAIJsn0yAI ouugj0Ct88ZNx20MIYE7FdlBPjmE9+BSq1E9Wm7wg4An3GcoFbGrroWbh8baZ/KUkhA3 VUNhUtiw4e+Z2lHdh48pAHkGY+gAAgvXeOT/bmhsi1DTD8z9ZZcnaXNIsfE2TYcU8thU H/G7ra1C3qAZS/AhOsj7lHZ0603zvbte8tcWc1C4HMF8RLb0BgQXocAJDoPSZ37anNia oEXA== 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=NxSWMfTKV0DnrGthCk2mW907OE06qEE2VFa75NVRydc=; b=s5JVoJhb9E6efVfL3cuxkARcY9WxVxZEe9lnlUZawbbu7uQwvHrqF8+L8yapnA/HPL bHX4TLOnivKdaV2wUNhPTMktp6/LFDkISlS5MhZJj+Az4zeajGb0rmtFnUJz9lYOzG6W eikiu5kG9CAB6rIMpLKrw/7S3dpGMBHg0YtU5M825BztwokzrPDJC7TOvDwVXuS4PuYb tcJM0gYMfi/euPxWTaWNAglJF+rhaIDENvnWyIUjMlkCR5tPb9IuHqOdwfBQokdQ2rSD QPTUgVnO+gXm7qbpHkGgKhf+QveX4z8ZDtia2UAeya5Bmk8XKUpomh/rYgmz6mL5Jd7p zmwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=LCGiZkjs; 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 w8si6047844iou.72.2021.05.21.13.41.59; Fri, 21 May 2021 13:42:11 -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=LCGiZkjs; 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 S231539AbhEUSPt (ORCPT + 99 others); Fri, 21 May 2021 14:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbhEUSPs (ORCPT ); Fri, 21 May 2021 14:15:48 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D89C061574 for ; Fri, 21 May 2021 11:14:24 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id z12so30334865ejw.0 for ; Fri, 21 May 2021 11:14:24 -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=NxSWMfTKV0DnrGthCk2mW907OE06qEE2VFa75NVRydc=; b=LCGiZkjsO9XXyvZkKrVWxXAX+RrHYsenY2uyMBTwo6hSFG5HeWx7I1UVVJDSXOGK+x u+vKph+AFQs9PQWmo4p7hw5aToK4VZ5QYOWBv7BxcP4uQwWC388TCzd8ti5RaUA1GlJH fsgW21AgVeenlTttTO+laAAP5XVwqJFnCx+S6ooi4WtpcSXlvXoqvR3lmKbsfbDcWewS w8nm27xO1kHoZjNXqfAD/a0zUdohuMeHxmcV+0OaFaNmvtkCVhPMPIFmxaUaL8ggGkHH 2UwuUJouMhhkDAqwCKHJcJsiA1+G0lZyjzaJoEYdiJ1S5M1Y58ELAbDkUkrHFwi/K6SB kfSQ== 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=NxSWMfTKV0DnrGthCk2mW907OE06qEE2VFa75NVRydc=; b=KcO3v/U14COyuViVWl/UZE/waejAxg79OredXRDLetcNVn4kKasIXxcdwI4+dSzqQb +4Mv3pMyfJhk0LQjn3bZWqvxrGSlyR4a7t0jWx9w7Awr6xWE111GqHqRVcwsYRLo2jKj dMm1eaC9T53cmnAUR+2XJll1+bWuSI5TWUW8Ab879oMEbe2UT15zhZzvhcET8Yw200Y8 muRQGZni3jE40iEob5O+xe8vhfUbRXvF7ZGCTKIGwRdcymTb0tLIVrDNwigij3CPjjCD 6XagYexCFS3fEJE+bNCRsyiJczxIWFbrJUniRPKXYv5Gz/ssZaMRM2OIBZ61pu1N0YOQ RVJA== X-Gm-Message-State: AOAM533UEUIt7hPCNjuz9utp4/miUtb4bymkQkAjPW571UjP0o9xqXFy 5kVe7RwfU9omxYygpKxcn1EoN/11N58kwWS8GcE= X-Received: by 2002:a17:906:a017:: with SMTP id p23mr11914838ejy.460.1621620863380; Fri, 21 May 2021 11:14:23 -0700 (PDT) Received: from neptune.. ([188.27.131.122]) by smtp.gmail.com with ESMTPSA id d15sm4566617edu.86.2021.05.21.11.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 11:14:23 -0700 (PDT) From: Alexandru Ardelean To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, support.opensource@diasemi.com, Alexandru Ardelean Subject: [PATCH] gpio: gpio-da9052: remove platform_set_drvdata() + cleanup probe Date: Fri, 21 May 2021 21:13:55 +0300 Message-Id: <20210521181355.9983-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-da9052.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c index 9aa59afdcbbf..559188d80c2b 100644 --- a/drivers/gpio/gpio-da9052.c +++ b/drivers/gpio/gpio-da9052.c @@ -196,7 +196,6 @@ static int da9052_gpio_probe(struct platform_device *pdev) { struct da9052_gpio *gpio; struct da9052_pdata *pdata; - int ret; gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); if (!gpio) @@ -209,15 +208,7 @@ static int da9052_gpio_probe(struct platform_device *pdev) if (pdata && pdata->gpio_base) gpio->gp.base = pdata->gpio_base; - 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 struct platform_driver da9052_gpio_driver = { -- 2.31.1