From patchwork Thu Jan 28 09:10:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12058527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3011EC433DB for ; Mon, 1 Feb 2021 09:31:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C6D464EAB for ; Mon, 1 Feb 2021 09:31:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C6D464EAB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a4dxRfLrhiFUdOWepNik0e9nhoTdI4XuNlg9BnEt97Q=; b=wUoGrL1Ml1Ew6eaDS051JyZgo VbNlsHWYke5ryv+RvJIbCpnTILLKSbhCB0BDFSi/QZz8ipY2LzWQQYXMyVgvKjUnp8PZ/prm+CEjS nI0Jp75zih/lWGUbuLSMDmVw6RAN18qb5eoWTcEGAUSFUderDCIg3IKVcSepP8YKV015L3P+EEyKP yRJC3pzmBaDCbKPxLxnqEinlNqqWYZPgAsjfCzY2gVnaaX3lY1IXALxk3mnF6XIM57eBi36F8uE+f ffx+aCvSdhIHUcu/rLxjzBvD6/rlo7+vTvxC2NJJR5KS+8D7XAm7eBfVAlJSoUC5qsgZVz2gCR57v RkGNNGcxA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6VY8-0007Oj-S9; Mon, 01 Feb 2021 09:31:12 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l53KJ-0007sn-5N for linux-i3c@lists.infradead.org; Thu, 28 Jan 2021 09:10:55 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l53KI-0006EQ-4a; Thu, 28 Jan 2021 10:10:54 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1l53KH-00071Y-Rq; Thu, 28 Jan 2021 10:10:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alexandre Belloni Subject: [PATCH 2/2] i3c: Make remove callback return void Date: Thu, 28 Jan 2021 10:10:48 +0100 Message-Id: <20210128091048.17006-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210128091048.17006-1-u.kleine-koenig@pengutronix.de> References: <20210128091048.17006-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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-i3c@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210128_041055_248285_FB14B901 X-CRM114-Status: GOOD ( 16.23 ) X-Mailman-Approved-At: Mon, 01 Feb 2021 04:31:10 -0500 X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The driver core ignores the return value of struct bus_type::remove() because there is only little that can be done. To simplify the quest to make this function return void, let struct i3c_driver::remove() return void, too. This makes it obvious that returning an error code is a bad idea and future driver authors cannot get that wrong. Up to now there are no drivers with a remove callback, so there is no need to adapt drivers. Signed-off-by: Uwe Kleine-König --- drivers/i3c/master.c | 10 +++------- include/linux/i3c/device.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 57a4f699eb8d..f8e9b7305c13 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -326,17 +326,13 @@ static int i3c_device_remove(struct device *dev) { struct i3c_device *i3cdev = dev_to_i3cdev(dev); struct i3c_driver *driver = drv_to_i3cdrv(dev->driver); - int ret = 0; - if (driver->remove) { - ret = driver->remove(i3cdev); - if (ret) - return ret; - } + if (driver->remove) + driver->remove(i3cdev); i3c_device_free_ibi(i3cdev); - return ret; + return 0; } struct bus_type i3c_bus_type = { diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h index de102e4418ab..8242e13e7b0b 100644 --- a/include/linux/i3c/device.h +++ b/include/linux/i3c/device.h @@ -176,7 +176,7 @@ struct i3c_device; struct i3c_driver { struct device_driver driver; int (*probe)(struct i3c_device *dev); - int (*remove)(struct i3c_device *dev); + void (*remove)(struct i3c_device *dev); const struct i3c_device_id *id_table; };