From nobody Sat Nov 23 19:53:47 2024 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2041.outbound.protection.outlook.com [40.107.247.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07EBB12CD96; Mon, 11 Nov 2024 07:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731309116; cv=fail; b=IrAvxdrCabrGI5WHwSdfbF+gzBFAx5RkQ/PViLOzBpFyNil1TpcKJarNAG73FOzFoX3HAuNNmvIsdO5IQEAWbt6hqMS89mJlqUFIZrx75un9S14J/Vd3i4TilvPXb8uaZ1ZO7We5v32BIiN1ezJcBi1RJqYAi+jM14awkbxdbAQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731309116; c=relaxed/simple; bh=fgOI0cbNLurXX5sQZfc1Of6LW3D8nVwf2alsTqAOZPg=; h=From:To:Subject:Date:Message-Id:Content-Type:MIME-Version; b=ALYusrhBC8afzjFCQ0EavhovcuOwiA1/PEXfBCkJ2NBxy47pVosWTtVOrLFpLPhDKG2GerkDSch4QdMJ0d9SuCWf37ZXiK2ZVbbcTxz5Dum7iwiXZin7njul7ZqGbb0VLhwkaeG8JI9gNE51TkFlQPKmvsyGqaELWz2LOdk3gXo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=i8Bapvn6; arc=fail smtp.client-ip=40.107.247.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="i8Bapvn6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K+htClZIFq2gQAOciGQXJ3QwkBpr4PG6u5lbLcARQwXa++NxK+P+X+3PMixlf3qSr8mqvKiO4CHeaFzMwK/r4EFbQF5ee3ypKJZWWkxwOqYmiu2q7w0U/I197iO8DvVM9m7fM+MADVnrQCdzFMRRfg3JJ5UcqAEUpXxrYyLuKBJRLgdTTlH0RN9fsVzStOPkRpDM/yxu2rKi9fq9Rii33KnQC2yiSuPxYbz45kTEPyxmT4sFspQOASeGOi76C23mdXgnSSxNZWGViM2QYgpNqZ9ST+F22yVHJ3krcIeW96pRnZXRCcyMBWdz7LJcMPhX5VzXpRehPk2QmFZ7RhSaXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5BOnosDsXJgQQ0clzhsYdEZyi8bAAVz5gKtxnfn2Q+0=; b=DJloN3Egtx9T9gZa48s/B+UyXqIhw9Lhkvr3y6oh5pMoW/LntZp5iU+sCXY9Le+UDSh8ZR5F7z8YRDwBkkxOnPZhwKOFlFdry4qMLo06Q5VZLA77zhpxfsk+rC5N/1YNyQfm8VvWEXqYbNS2wjV69BNhfgHUSVAUrD9Cks3nnPcjKWfi/6yliOd7j8W+l31Gyng2iazaxU0sRNQOsLquj9XsFVDsUG+c3OhkiMEvZvSPmOKvfbO3maTzRXkglWYY6kkB9WCKyr2VQ7ietcezf5WLhpUxdcPfdnDAoXfAlF1C2ONcVidExXrJQFYV3wxm7iSL3pUC0XbY0Ual3M37dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5BOnosDsXJgQQ0clzhsYdEZyi8bAAVz5gKtxnfn2Q+0=; b=i8Bapvn6DTcjc9hE/rGEEiImDg4PzeBoKtL1vjszBJXuzgu1w7zBZlCMINu5Xl/ZGvSIzgY7SMPR1yPFLilT6GZJTcAxL6mYALykQHu3oz0cWc+miSFEhlgW4DmtJl+ITMDp3NqZuvTWCDvj08G7cGE9X8gl1OETSkElEyQcBon2khJvqzuxffMACrArKYB96sWx6Qvb58LAH4NlnXoAr5AJA0+sUDVP3+4ujFwx4AjTvNtPsxLw6bT13gNE/b+VgVZmXE3Pa8TX+2KRsMFeTYvjk6Yk2UlT+FMAHltPmmnEfgAtrRZIXzYJkFjHQQ6JaI09d2e/VJLro1MzvwDUaA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by DBBPR04MB8010.eurprd04.prod.outlook.com (2603:10a6:10:1f1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 07:11:50 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 07:11:50 +0000 From: "Peng Fan (OSS)" To: Alexandre Belloni , Peng Fan , Jacky Bai , linux-rtc@vger.kernel.org (open list:REAL TIME CLOCK (RTC) SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V3] rtc: bbnsm: add remove hook Date: Mon, 11 Nov 2024 15:11:30 +0800 Message-Id: <20241111071130.1099978-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2PR02CA0066.apcprd02.prod.outlook.com (2603:1096:4:54::30) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|DBBPR04MB8010:EE_ X-MS-Office365-Filtering-Correlation-Id: d435326e-7812-4c04-b002-08dd02201c85 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Q7XrmJ7STnG0VCJBWD7Nak8oOfZpXQ3gaBRbwFSsSMKW2MJfstDDkRnRq0hu?= =?us-ascii?Q?VCsgFseAJH+/1ujjziu9GOXsXYxAU9Vy8aiymPEO4nQB76Tpa35b65jqhyxH?= =?us-ascii?Q?3ZNspjVRG/5r8npuc7BEY6OiHkf6x12IqxcZjetz6mq15tQ4MhkFEWbpdfpz?= =?us-ascii?Q?AbCsWKiPhwzd3lasbg1Nux9hrTgCKhNGvX4e2ByGjMOMx3LQ//93Qak/MYVo?= =?us-ascii?Q?+Lcewnr6e5WP1eQKPaqIZ/Q17j7ONyABfA/o22O8mM9Cb1taCQ1O9AC45kbS?= =?us-ascii?Q?YrIL9ME0Zx4L/aCHlb3B0qqKrZDSNTd74AUcxU6z6cy4WtNEOOuct65wEQmF?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65JipIim5RrTkolDroo9E?= =?us-ascii?Q?YpvzG1WUbkFwTB3+ZOaoEbwmzZxetz5RK6wk45B9tlDYZFvML1R1AQKs9YGo?= =?us-ascii?Q?H8JkV+w/b4/3CH+V1Icn2NEgo31QqX7v3Js5NoVDYBPpYutHrmRPSZoPv2zg?= =?us-ascii?Q?Dm9EjWI=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uxXYY/M4qbii09At2XhuuTc6WquxGpqJ9zss3m3uN9MffCDbTjwimb71x7pH?= =?us-ascii?Q?6oOwePqfKKdVMrECtCHnMs5T6PbWBjogC0deQXtmR9EerkcLUisxMl/u2U6D?= =?us-ascii?Q?hKJ0O9cy35CZG8wJ1hALhHtmT3ol5G+RYH72ApvjQN3JnJH81QhMmNs7GYnY?= =?us-ascii?Q?4sOjlHvNNWNAWLyCeJy0GEbf1tBix46Vm7OY13dqbznh3UDBb1N/sRbdXvaU?= =?us-ascii?Q?TRFXwfD24kuDhkCXHu5Z97vnY2vmhKhzK8H+GqEMHFwZaaa75cqmGeEErS1W?= =?us-ascii?Q?wI/zEjNBgF9NeTO0YaFA+0YvS1XOVko1o9FA5oEtrCA4J3YMRS03BgDeW8+p?= =?us-ascii?Q?hdroQFRwcYy5hrqzbF9L7BxcRvPAH1JXDC9GPJXXKDm3EWXPTJ3PmMVyZ0Y9?= =?us-ascii?Q?pgdfzgFBFcNMGJbhvvqQqOST9cj5c0314qcGdVLPW7WnE7aTInQYZmVbC5bX?= =?us-ascii?Q?zIUa7TBEVuoWjXFTr9d22AmjahRtzknm3mMPx1VoViAYs+2Hrf5nk4/lbqU6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ml1IDhybJjkqfCrTjIr6ytgzt5/cm2?= =?us-ascii?Q?WlWTGPLztMAXM9R+P1wb6mkWR/KgO2CBUdDMVNIVie+blIOxdhwyHEcpQ2nO?= =?us-ascii?Q?IHo7kQDfsO5g6EZUpQwTeK7awKxNizP4kqZZeVtdL1vqBKijMBB34Ngx158U?= =?us-ascii?Q?itNeY8L9eph/mCLmpoCchCDDHOd5mwPe6OczMbtX?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d435326e-7812-4c04-b002-08dd02201c85 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 07:11:50.0374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: piWRuBTWNLeVTQYgwGND6eQEc+T6tR9jgIROquiI3lNJwtryyWomno1pr46dKEXBvJPrBQJhKKT7luzIDf/h1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8010 Content-Type: text/plain; charset="utf-8" From: Peng Fan Without remove hook to clear wake irq, there will be kernel dump when doing module test. "bbnsm_rtc 44440000.bbnsm:rtc: wake irq already initialized" Add remove hook to clear wake irq and set wakeup to false. Fixes: eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support") Signed-off-by: Peng Fan --- V3: Drop ununeeded error message V2: Per Christophe JAILLET Use remove, not remove_new Fix error handling in probe drivers/rtc/rtc-nxp-bbnsm.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-nxp-bbnsm.c b/drivers/rtc/rtc-nxp-bbnsm.c index acbfbeb8b070..fa3b0328c7a2 100644 --- a/drivers/rtc/rtc-nxp-bbnsm.c +++ b/drivers/rtc/rtc-nxp-bbnsm.c @@ -197,13 +197,28 @@ static int bbnsm_rtc_probe(struct platform_device *pd= ev) if (ret) { dev_err(&pdev->dev, "failed to request irq %d: %d\n", bbnsm->irq, ret); - return ret; + goto err; } =20 bbnsm->rtc->ops =3D &bbnsm_rtc_ops; bbnsm->rtc->range_max =3D U32_MAX; =20 - return devm_rtc_register_device(bbnsm->rtc); + ret =3D devm_rtc_register_device(bbnsm->rtc); + if (ret) + goto err; + + return 0; + +err: + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); + return ret; +} + +static void bbnsm_rtc_remove(struct platform_device *pdev) +{ + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); } =20 static const struct of_device_id bbnsm_dt_ids[] =3D { @@ -218,6 +233,7 @@ static struct platform_driver bbnsm_rtc_driver =3D { .of_match_table =3D bbnsm_dt_ids, }, .probe =3D bbnsm_rtc_probe, + .remove =3D bbnsm_rtc_remove, }; module_platform_driver(bbnsm_rtc_driver); =20 --=20 2.37.1