Message ID | 20210707162835.1772882-42-u.kleine-koenig@pengutronix.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-pwm-owner@vger.kernel.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=<UNKNOWN>) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4GKllr706Mz9sXS for <incoming@patchwork.ozlabs.org>; Thu, 8 Jul 2021 02:50:16 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbhGGQwz (ORCPT <rfc822;incoming@patchwork.ozlabs.org>); Wed, 7 Jul 2021 12:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbhGGQww (ORCPT <rfc822;linux-pwm@vger.kernel.org>); Wed, 7 Jul 2021 12:52:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37282C061765 for <linux-pwm@vger.kernel.org>; Wed, 7 Jul 2021 09:50:09 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1m1AkQ-0007Bm-LS; Wed, 07 Jul 2021 18:50:06 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1m1AkP-0002f6-Gh; Wed, 07 Jul 2021 18:50:05 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1m1APm-0006Js-TN; Wed, 07 Jul 2021 18:28:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Thierry Reding <thierry.reding@gmail.com>, Lee Jones <lee.jones@linaro.org> Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 41/47] pwm: pca9685: Don't check the return code of pwmchip_remove() Date: Wed, 7 Jul 2021 18:28:29 +0200 Message-Id: <20210707162835.1772882-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210707162835.1772882-1-u.kleine-koenig@pengutronix.de> References: <20210707162835.1772882-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pwm@vger.kernel.org Precedence: bulk List-ID: <linux-pwm.vger.kernel.org> X-Mailing-List: linux-pwm@vger.kernel.org |
Series |
pwm: Make pwmchip_remove return void
|
expand
|
diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c index 42ed770b432c..c56001a790d0 100644 --- a/drivers/pwm/pwm-pca9685.c +++ b/drivers/pwm/pwm-pca9685.c @@ -601,11 +601,8 @@ static int pca9685_pwm_probe(struct i2c_client *client, static int pca9685_pwm_remove(struct i2c_client *client) { struct pca9685 *pca = i2c_get_clientdata(client); - int ret; - ret = pwmchip_remove(&pca->chip); - if (ret) - return ret; + pwmchip_remove(&pca->chip); if (!pm_runtime_enabled(&client->dev)) { /* Put chip in sleep state if runtime PM is disabled */
pwmchip_remove() returns always 0. Don't use the value to make it possible to eventually change the function to return void. Also the driver core ignores the return value of pca9685_pwm_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-pca9685.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)