From patchwork Mon Oct 16 16:10:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBC54CDB474 for ; Mon, 16 Oct 2023 16:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232152AbjJPQKO (ORCPT ); Mon, 16 Oct 2023 12:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJPQKO (ORCPT ); Mon, 16 Oct 2023 12:10:14 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C2BAB; Mon, 16 Oct 2023 09:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472612; x=1729008612; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yOQZfIm040lvmUe2O+DKvT56T78+nm6brIphWp/oItE=; b=cUW8pk80y+3RVyF2reTjUK0cZQ/eEVQZx9bpLrGm4HCPjQq4ACx9QHyx 1u1GXvX7FqRpRnO1cVkZ9ieaUW5KnOdK+ymVRROhfFPBgVIfvRXRpcKEl lhzo5K2D6fHgh8U/JafKsydheZr86jKw0/eAEAIn83bbTBarrc7T+qRro JsB1vS1VvbhojUHkLs9p5FmSwMxBaYDXhrUs1lSFMDCOTtQooWNgSAHV6 ZUg24PvcsgJrdWO0JY5IwWOJRf3cpsp0HnFEPxrkP+T9ZSJD7160sTLwB KWrWECe2OERkRYSBh31xGEoFClDeo8yjt7GmM1kDg3wTuI0hDMeQTsSMG w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="4175721" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="4175721" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="1087124866" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="1087124866" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 16 Oct 2023 09:10:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EA49781C; Mon, 16 Oct 2023 19:10:08 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 1/6] leds: gpio: Keep driver firmware interface agnostic Date: Mon, 16 Oct 2023 19:10:00 +0300 Message-Id: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org The of.h is used as a proxy to mod_devicetable, replace former by latter. The commit 2d6180147e92 ("leds: gpio: Configure per-LED pin control") added yet another unneeded OF APIs. Replace with direct use of fwnode. Altogether this makes driver agnostic to the firmware interface in use. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index a6597f0f3eb4..debadb48ceda 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -11,8 +11,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -129,8 +129,8 @@ static int create_gpio_led(const struct gpio_led *template, ret = PTR_ERR(pinctrl); if (ret != -ENODEV) { dev_warn(led_dat->cdev.dev, - "Failed to select %pOF pinctrl: %d\n", - to_of_node(fwnode), ret); + "Failed to select %pfw pinctrl: %d\n", + fwnode, ret); } else { /* pinctrl-%d not present, not an error */ ret = 0; From patchwork Mon Oct 16 16:10:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1397CDB465 for ; Mon, 16 Oct 2023 16:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbjJPQKg (ORCPT ); Mon, 16 Oct 2023 12:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233746AbjJPQKd (ORCPT ); Mon, 16 Oct 2023 12:10:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 360C0F2; Mon, 16 Oct 2023 09:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472631; x=1729008631; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cvuQMHb9LmDrcSq69UbNf/WifWB3BY+q2NCKjOo91RU=; b=W6o2Y3WaRlIsFT6xoLxifGUMMYeyxfKpJa4G3qLa9mSLWzmIJKhliTLR DXjkkv2kCRGL3GVo27lNzxQ/DUdpzYV6T5kvqWMTcWX5/a+DKz68rbihZ CEMyUn0+AmWTe3kxlARJ17mnsQRyWVhayftDVYkkmKoYG7vobw9iFWRNZ Jli2hy/O/PVdADyPjR4kQf4axnm8Pet4CkwyCzrcLvllqTtqs1UqJRSUm HUgHGYvl1I7aZnhKxgI7qRwOcVd8yrCDX7YwMYoqCpMZ4nDjpb419aZZL DVfazt2N05Gw8OhlFpIBbWtrz/cUexMVsDCHBCKzmWV19s83hOH29WdVy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="7132785" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="7132785" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="785123038" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="785123038" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 16 Oct 2023 09:10:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0A927385; Mon, 16 Oct 2023 19:10:08 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 2/6] leds: gpio: Utilise PTR_ERR_OR_ZERO() Date: Mon, 16 Oct 2023 19:10:01 +0300 Message-Id: <20231016161005.1471768-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> References: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Avoid a boilerplate code by using PTR_ERR_OR_ZERO() in create_gpio_led(). Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index debadb48ceda..4071cb9eefec 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -125,16 +125,13 @@ static int create_gpio_led(const struct gpio_led *template, return ret; pinctrl = devm_pinctrl_get_select_default(led_dat->cdev.dev); - if (IS_ERR(pinctrl)) { - ret = PTR_ERR(pinctrl); - if (ret != -ENODEV) { - dev_warn(led_dat->cdev.dev, - "Failed to select %pfw pinctrl: %d\n", - fwnode, ret); - } else { - /* pinctrl-%d not present, not an error */ - ret = 0; - } + ret = PTR_ERR_OR_ZERO(pinctrl); + /* pinctrl-%d not present, not an error */ + if (ret == -ENODEV) + ret = 0; + if (ret) { + dev_warn(led_dat->cdev.dev, "Failed to select %pfw pinctrl: %d\n", + fwnode, ret); } return ret; From patchwork Mon Oct 16 16:10:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C89B7CDB482 for ; Mon, 16 Oct 2023 16:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233686AbjJPQKS (ORCPT ); Mon, 16 Oct 2023 12:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJPQKQ (ORCPT ); Mon, 16 Oct 2023 12:10:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7482AE6; Mon, 16 Oct 2023 09:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472613; x=1729008613; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r8k8DrgrN+0Ylm+kKwsZKCjBoAC5iHc0h68Upva4lbg=; b=W3XBeBwP0RCbyD6FFJ4ceCkk822Bpj/04V+aN8hVF/zFR15tlSy5va8j Mm/SGAmt6uMwlOZWm9ROhZ7kmwjp7hQEp4ks6RnzS1EsIRQUKmCWEG80v nDrCG6t2w2qDXrjJvKQ6Mq7B9EE9FC9ZLFqsKZSAZcMQqTlNTAJjmVssc ffL3WMxdibM+w+pvIOnDFiAepyghe4R171MYYrAbwugZxiA1tl1BskwK6 iA+NnfrgGu976NKCUJbecXFsw0/+GMsrySpTQXKcz9L9HM0gjJszxMNua yLU9yZkPu1b/c9Zy0ZCz5d/AEaI8CQ4klq1WeanQIwKWgmUa8ZrgFpX59 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="4175724" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="4175724" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="1087124867" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="1087124867" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 16 Oct 2023 09:10:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 164EF85E; Mon, 16 Oct 2023 19:10:09 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 3/6] leds: gpio: Refactor code to use devm_gpiod_get_index_optional() Date: Mon, 16 Oct 2023 19:10:02 +0300 Message-Id: <20231016161005.1471768-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> References: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Instead of checking for the specific error codes, replace devm_gpiod_get_index() with devm_gpiod_get_index_optional(). In this case we just return all errors to the caller and simply check for NULL in case if legacy GPIO is being used. As the result the code is easier to read and maintain. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 4071cb9eefec..7c9c6a93dfd7 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -218,13 +218,13 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx, * device, this will hit the board file, if any and get * the GPIO from there. */ - gpiod = devm_gpiod_get_index(dev, NULL, idx, GPIOD_OUT_LOW); - if (!IS_ERR(gpiod)) { + gpiod = devm_gpiod_get_index_optional(dev, NULL, idx, GPIOD_OUT_LOW); + if (IS_ERR(gpiod)) + return gpiod; + if (gpiod) { gpiod_set_consumer_name(gpiod, template->name); return gpiod; } - if (PTR_ERR(gpiod) != -ENOENT) - return gpiod; /* * This is the legacy code path for platform code that From patchwork Mon Oct 16 16:10:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EBB3CDB465 for ; Mon, 16 Oct 2023 16:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbjJPQKd (ORCPT ); Mon, 16 Oct 2023 12:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233708AbjJPQKb (ORCPT ); Mon, 16 Oct 2023 12:10:31 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F44AFA; Mon, 16 Oct 2023 09:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472629; x=1729008629; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F25NQtPqRcWKTHovw7qS8Bdu+1VMkD5tR6I2DEWwAqs=; b=jQBJ2hwoROkx8FvePD8cc/B7D1l+VXlme1DFt/iGGBKcva08wcvm21sU 7OYV/1S2/wGFX3XV9lxfb+C23cQxCnQJMxX4Q31yYAph+X1TjxkHA39nf MhW6QMxPoM0JhPDi+k1gEDt1HdE/tThYJgG2Hm3fFb0n6+oC5aUPfLpVX HQsbdkID3+lHJDbZ13+zFpZ0zKzm7zRZXDYi6Pc8TulGgSmE3zYn+bj1B mhEGhydFuGMQCg5gmqjK/LYLpzGn4QEghdGhU353lPhh44hvcjOU1H0rx RzPaPqZdSZ0cGp5L/0AzMAgRsOIKSc/nY8mz+9i04oPYkRJRDJEBisRmL Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="7132780" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="7132780" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="785123039" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="785123039" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 16 Oct 2023 09:10:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2FDCE988; Mon, 16 Oct 2023 19:10:09 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 4/6] leds: gpio: Move temporary variable for struct device to gpio_led_probe() Date: Mon, 16 Oct 2023 19:10:03 +0300 Message-Id: <20231016161005.1471768-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> References: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Use temporary variable for struct device in gpio_led_probe() in order to make code neater. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 7c9c6a93dfd7..fd3f90f95fa2 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -142,9 +142,8 @@ struct gpio_leds_priv { struct gpio_led_data leds[] __counted_by(num_leds); }; -static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) +static struct gpio_leds_priv *gpio_leds_create(struct device *dev) { - struct device *dev = &pdev->dev; struct fwnode_handle *child; struct gpio_leds_priv *priv; int count, ret; @@ -253,13 +252,13 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx, static int gpio_led_probe(struct platform_device *pdev) { - struct gpio_led_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct gpio_led_platform_data *pdata = dev_get_platdata(dev); struct gpio_leds_priv *priv; int i, ret = 0; if (pdata && pdata->num_leds) { - priv = devm_kzalloc(&pdev->dev, struct_size(priv, leds, pdata->num_leds), - GFP_KERNEL); + priv = devm_kzalloc(dev, struct_size(priv, leds, pdata->num_leds), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -272,22 +271,20 @@ static int gpio_led_probe(struct platform_device *pdev) led_dat->gpiod = template->gpiod; else led_dat->gpiod = - gpio_led_get_gpiod(&pdev->dev, - i, template); + gpio_led_get_gpiod(dev, i, template); if (IS_ERR(led_dat->gpiod)) { - dev_info(&pdev->dev, "Skipping unavailable LED gpio %d (%s)\n", + dev_info(dev, "Skipping unavailable LED gpio %d (%s)\n", template->gpio, template->name); continue; } - ret = create_gpio_led(template, led_dat, - &pdev->dev, NULL, + ret = create_gpio_led(template, led_dat, dev, NULL, pdata->gpio_blink_set); if (ret < 0) return ret; } } else { - priv = gpio_leds_create(pdev); + priv = gpio_leds_create(dev); if (IS_ERR(priv)) return PTR_ERR(priv); } From patchwork Mon Oct 16 16:10:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEB59CDB474 for ; Mon, 16 Oct 2023 16:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233788AbjJPQKf (ORCPT ); Mon, 16 Oct 2023 12:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233737AbjJPQKd (ORCPT ); Mon, 16 Oct 2023 12:10:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BE46FF; Mon, 16 Oct 2023 09:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472632; x=1729008632; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CCalplfZS+ACuqT2hqG7Ibb2XR+tCJlozM7ZHTv3bHw=; b=JhGn1LyfunZ/wca0dwSmDDen57X1DmjedFlLs7cOs/Gd+MFh0QZnjGXO D+wvGqdNr6FHpCGj8w2d8Yh4B2pERtWdxPMwRRZU0lv4dbMdCXu36T7jc YJacfUCM7xLYuDFo++im30hfm4umwxA8AK+Qd75tul90Hhel5eZt51Xzg C1piMhyBQxpk9I6JsZVmVYlT7jQiJoh7d1DA+AOohiNmbKetWIwe/hfdn xp3Ge7XRZk4U/3PV2nDt0927Syz/vsodZ7tTzMNu1PugEUQ8DBVEN5l9K G06srvU/FjFHyLHTkQN4+JX63JuQyfCmxFzcRSh/ShIEaFBkhd6q1a3AC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="7132787" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="7132787" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="785123040" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="785123040" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 16 Oct 2023 09:10:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 36C5995B; Mon, 16 Oct 2023 19:10:09 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 5/6] leds: gpio: Remove unneeded assignment Date: Mon, 16 Oct 2023 19:10:04 +0300 Message-Id: <20231016161005.1471768-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> References: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org The initial ret is not used anywhere, drop the unneeded assignment. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index fd3f90f95fa2..d6e8298ffb3e 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -255,7 +255,7 @@ static int gpio_led_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct gpio_led_platform_data *pdata = dev_get_platdata(dev); struct gpio_leds_priv *priv; - int i, ret = 0; + int i, ret; if (pdata && pdata->num_leds) { priv = devm_kzalloc(dev, struct_size(priv, leds, pdata->num_leds), GFP_KERNEL); From patchwork Mon Oct 16 16:10:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 734834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76A65CDB465 for ; Mon, 16 Oct 2023 16:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232389AbjJPQLS (ORCPT ); Mon, 16 Oct 2023 12:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234026AbjJPQLF (ORCPT ); Mon, 16 Oct 2023 12:11:05 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C78AD56; Mon, 16 Oct 2023 09:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697472658; x=1729008658; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YUkxCSHEq/3rOrfuT0Fg4DI7Hj9/49mwADVgWbNCxXM=; b=cVj697GdHtSBBYSmilaMSM9/h6D4j+erxXqGAXQmtopyenkoDo2pzX9/ J+0HhVJ1anSDYgaqvoz2/98mKksvXyzpIcjs9GHt+zeaUgBHcAXRjleI7 DsIpUMu1TRka2M7uAUAAFk7cwE65ty1cNRGRrx1xZ1WM0InPlWiFzpaKM 1xQI+abtg4UAy54tdOrjPEb5BavkyLojTzArkqwrvVidp2HYSEhtIedTF JcL50o5lhO38Q7BL+SGKHVSyMF3cVBtmwJ2+S31YKVMY/AJeBW8o2oGA9 K0vdnlyuQlnkRQYEJZaiysr9GPZlao5/Vaaq4hF13Q0oq1903IUCVGoYQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="384440997" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="384440997" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:10:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="790856636" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="790856636" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 16 Oct 2023 09:10:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 48A5EA46; Mon, 16 Oct 2023 19:10:09 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 6/6] leds: gpio: Update headers Date: Mon, 16 Oct 2023 19:10:05 +0300 Message-Id: <20231016161005.1471768-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> References: <20231016161005.1471768-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Include headers which we are direct users of, no need to have proxies. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-gpio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index d6e8298ffb3e..710c319ad312 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -6,17 +6,21 @@ * Raphael Assenat * Copyright (C) 2008 Freescale Semiconductor, Inc. */ +#include +#include #include #include #include -#include #include #include #include +#include #include #include #include #include +#include + #include "leds.h" struct gpio_led_data {