From patchwork Wed Feb 15 17:04: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: 654304 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 690B3C636D4 for ; Wed, 15 Feb 2023 17:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbjBORFb (ORCPT ); Wed, 15 Feb 2023 12:05:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjBORFa (ORCPT ); Wed, 15 Feb 2023 12:05:30 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BF23669D; Wed, 15 Feb 2023 09:05:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676480721; x=1708016721; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EkzFT1Nke/B9I8aR5SnJ8afv1Mh9pNWCQQ/xa3G/7d0=; b=Wr3rTZrgtWAfhc8fKQGgLyULBK9/YwycvUcEcVr2JL9ONLxdBHpoKgWe USUlaEhtjpyw4u0J4OpmvVaiUBulH/C1OxB1RleNn7aPWhJo0pYy5xANk hBx3ProW6Xg/FzReNWh+9X0zzBPP+QE+jgDOQfNlDw0/9TSqF6RkbRha7 UIAJS86O7l0saapAAxrAgKFheAjrAxbYHIZOwCdOo/mS2uTqo0LEUXyRL W4oNGjTxShP8ZmMfmNb7U1/cq4hclNdcw/RYFSsRh3kihkjNbZjlhesja rVhRhgI/++TgAdJ1812pD6vhNZyithFr+GgvkKYTDcimDIiLga3YicWG/ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="393886453" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="393886453" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:03:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="647262367" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="647262367" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 15 Feb 2023 09:03:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2070B1A6; Wed, 15 Feb 2023 19:04:07 +0200 (EET) 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/2] leds: lp8860: Remove unused of_gpio,h Date: Wed, 15 Feb 2023 19:04:02 +0200 Message-Id: <20230215170403.84449-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org of_gpio.h provides a single function, which is not used in this driver. Remove unused header. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-lp8860.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index b66ed5ac1aa5..666f4d38214f 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include From patchwork Wed Feb 15 17:04: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: 653849 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 54781C636D4 for ; Wed, 15 Feb 2023 17:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbjBORFI (ORCPT ); Wed, 15 Feb 2023 12:05:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjBORFG (ORCPT ); Wed, 15 Feb 2023 12:05:06 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7569859DA; Wed, 15 Feb 2023 09:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676480705; x=1708016705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rOimDod//OCrW4INcjgAv6xJyq0ZxmoU28TD++6SzWw=; b=EJvr2QE4SDnC0NgYijXHTzKlzyKbs/SfTsWrEFoKNWrk137d4vBImKOl d0sc/Ak0HqmfV/IdAJF/C2lT6yr96Ky4Wj65ERvjIoW8cwzLu75AGPsNq WQEEWeXafpr6K+4f7/peYKTTIjI5JCjCdu8DEX8JU//Th1j+6DSiCcV7W DfoH+c7EXoQnNV0S//jh1fGNIKk1mTScbtQ4JhXmxGo74XIAMZeLtKKBD riwvLllsHsOh+ZJKR8TXqUBBVubiVC/khXGbMpMB0YN6CXZkk4V25HOgr Y8SaOdd2jra6NaOHPTkFFB2UqIZ9W6XklPhn7B1gjDKWEPVcfVflGF91c Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="311847975" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="311847975" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:03:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="812539731" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="812539731" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2023 09:03:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AFAC91C5; Wed, 15 Feb 2023 19:04:07 +0200 (EET) 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/2] leds: lp8860: Remove duplicate NULL checks Date: Wed, 15 Feb 2023 19:04:03 +0200 Message-Id: <20230215170403.84449-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230215170403.84449-1-andriy.shevchenko@linux.intel.com> References: <20230215170403.84449-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org gpiod_*() API check already for the NULL, no need to repeat that in the driver. Signed-off-by: Andy Shevchenko --- drivers/leds/leds-lp8860.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 666f4d38214f..221b386443bc 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -249,8 +249,7 @@ static int lp8860_init(struct lp8860_led *led) } } - if (led->enable_gpio) - gpiod_direction_output(led->enable_gpio, 1); + gpiod_direction_output(led->enable_gpio, 1); ret = lp8860_fault_check(led); if (ret) @@ -293,8 +292,7 @@ static int lp8860_init(struct lp8860_led *led) out: if (ret) - if (led->enable_gpio) - gpiod_direction_output(led->enable_gpio, 0); + gpiod_direction_output(led->enable_gpio, 0); if (led->regulator) { ret = regulator_disable(led->regulator); @@ -448,8 +446,7 @@ static void lp8860_remove(struct i2c_client *client) struct lp8860_led *led = i2c_get_clientdata(client); int ret; - if (led->enable_gpio) - gpiod_direction_output(led->enable_gpio, 0); + gpiod_direction_output(led->enable_gpio, 0); if (led->regulator) { ret = regulator_disable(led->regulator);