From patchwork Sun Mar 26 14:30:51 2023 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: 13188143 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 2E2E2C761AF for ; Sun, 26 Mar 2023 14:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -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 8AE867AAB for ; Sun, 26 Mar 2023 07:32:34 -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 ) id 1pgRQ8-0007t0-2K; Sun, 26 Mar 2023 16:32:32 +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.94.2) (envelope-from ) id 1pgRQ7-006raa-ES; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088VJ-Oj; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 024/117] media: marvell: Simplify remove callback Date: Sun, 26 Mar 2023 16:30:51 +0200 Message-Id: <20230326143224.572654-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=590D1CAL0pYMC213PLVi2ZUu4XhyxHq+x11/2JonYDU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFajNsUg4ndB8z7Vo8Sv5E+wNVkolkuE9Z4CN Ilk2XUcK+WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWowAKCRCPgPtYfRL+ Ts8RB/46TXa6W64pczpya/EuOAOJQhwdTrkiCLX69bXqCoyMiu4wP3y/OziMVIP76bTiKpcQ+71 obiG7os0g0pkifi4+fgkyEr2T30cFUXXfvrNDL0iUbN/M4WRYxbZbVhBfE6Az9le0zp9BLvbCyW rtSgnLcizDd4qVJovTDOr9yPSbLhnewQlMTooM4xGjM+SiNeWEk53XhSBOjz40BJtCO3SPZpB3x zZOOJ+WZ3qYFaWzWUf+zVNXyslp4KTTRHzghPi0wx9gQo8uk1LvLPQdHl8+jgHUx077+7/n+fbP HN7NDDjQZ21eQeAbQ3RAEPtNlQdzA5a1lFNdFNvjLzzxtOXp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fold mmpcam_remove() into its only caller mmpcam_platform_remove(). Note that cam can never be zero, as the probe function calls platform_set_drvdata() with a non-NULL argument (or returns an error code in which case .remove() won't be called). Also use mmpcam_remove() as the function name for the remove callback to align to mmpcam_probe() for .probe(). Signed-off-by: Uwe Kleine-König --- drivers/media/platform/marvell/mmp-driver.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/marvell/mmp-driver.c b/drivers/media/platform/marvell/mmp-driver.c index ef22bf8f276c..964c55eacd89 100644 --- a/drivers/media/platform/marvell/mmp-driver.c +++ b/drivers/media/platform/marvell/mmp-driver.c @@ -287,9 +287,9 @@ static int mmpcam_probe(struct platform_device *pdev) return ret; } - -static int mmpcam_remove(struct mmp_camera *cam) +static int mmpcam_remove(struct platform_device *pdev) { + struct mmp_camera *cam = platform_get_drvdata(pdev); struct mcam_camera *mcam = &cam->mcam; mccic_shutdown(mcam); @@ -297,15 +297,6 @@ static int mmpcam_remove(struct mmp_camera *cam) return 0; } -static int mmpcam_platform_remove(struct platform_device *pdev) -{ - struct mmp_camera *cam = platform_get_drvdata(pdev); - - if (cam == NULL) - return -ENODEV; - return mmpcam_remove(cam); -} - /* * Suspend/resume support. */ @@ -369,7 +360,7 @@ MODULE_DEVICE_TABLE(of, mmpcam_of_match); static struct platform_driver mmpcam_driver = { .probe = mmpcam_probe, - .remove = mmpcam_platform_remove, + .remove = mmpcam_remove, .driver = { .name = "mmp-camera", .of_match_table = of_match_ptr(mmpcam_of_match),