From patchwork Thu Dec 5 16:51:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13895790 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) (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 C8097226ED4 for ; Thu, 5 Dec 2024 16:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733417498; cv=fail; b=iQe3ckSzYZgM+G8eIVEhFJA3g9NuG388bLIjvcDAmh87IsXJ1gxUMbf3tAA3yYOCnHYIfFDEXKKEGfPTIbVe498BM4SjX7+EcnMhXUqBQ+JTLoIrn0DY+5hKeu8uJ7TM11nILFBlt1MUGOVxFBd4km0VHMJvrFh6Dn00wuYNVds= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733417498; c=relaxed/simple; bh=a+/tdvfNrna1Hxq1r+zVZqlrUGxbeu/wyD9Dmoa9nNQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=N5jRdbHIkP4vJ2tXpiQ8yAyGHNBxQ/n9QhXB1821qhbSTZHd/uatB2rgcuh8bVzdT02wtrV9pTrJQujjF4Kp405mNBQYdy64Dw3Ii4l08RxAPs8dEoFDo2nY2JT34cCpEBqOx3b/leZIuSk+Srnt8zAhazlulKE+ZBKUV5YCTU8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=c33WNS/K; arc=fail smtp.client-ip=40.107.20.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="c33WNS/K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=euZUYETpnlbVgx1Y/ZiNbk5O6UqVw0ChMtXX4xBNusWgLPxsd+iYAH3sa6+vHnhvMAD0wVlUv70FbNCjuHc+oX1ZUHp1yxxucFAdddgTKSPlZvULWAB5JSMWfmOazv1yTDxRPH908qVN/YTFvSAIfd+SXQSQTxzZZele+x2UHV4DjwsIJ4GMaMXOKmCeQBHVxNXtUHepjKFaZywXa6z5BDHbx5Hr+wy0OLogu2Noz6UwVYGAGq7Z8B37JdCjBwCLK/FSzKc/eWpQtKPH7pb55ambjcHZ0XRuaaJdCmz/ejODzK8cA3NFrXHGRxfIEuDkm9IfJCPRW5rThwDuilmUbQ== 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=yLDBtNfni/M0yr6E6A9udqNvO4y+WKxsbN6N+QmozXQ=; b=Rq5+DQ+Bs3e8/yEGLDMFgOE8fkCu+bnXwy0UEemwLNoDgYBkRpScjL5DL8eFIEG5QfsdIMfLiX97Ytlws/yUXv/o0ju7h0ITc4TA0joq+JhNjsvn3p2PlSjlNGoyYsXSyXgTqqZ6wcqzZu+Kl1aUrW/+BOymyCGkMQ/z1CvrwbcL4sx9grnt9f5KOL7uUquCAgAc9YYl+EYdB5Ej5vurMEl8uWF+NSpbj2blxdd3sQApI7CnHNeCKhJq8g6wINlVjZo1dMPeSNTIaeAGg/31RYr5xdCRUQIlFGKcvhO+jhPhuT9DnOGlz5Hl7ogiN3sZpbkPkp+Ob8blQ1s43uXkGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yLDBtNfni/M0yr6E6A9udqNvO4y+WKxsbN6N+QmozXQ=; b=c33WNS/KfisrULUGfVAvZeFW0GbE6Uhql+OUdrhu5OzKPJkwYsqC9RI9nVb3imWD58idRpjtCwHMJ1uJMuTXuXYOHvf78f1A1W2HWESWL48tnuhuRXpes28SZ4RjN1ClPXBOSxLkY/JDRFrvBSsFthTpDyO6CF+LZWFE8Dveh92TpFdbsT5IV4+TpxncqlfApCDxJUA44RwypLgjSnrT3alLEuu7br5K1NXBZl8CpoUxatxh7THFKQTLlVda/42lIr7eCgRYH1Pbl3i7ioY7uP4/v5P471VaLC5Av9+eEvFGcIrM/kjVF6G7d50RV8twA2Uka8fqi2+VdtDkOaXKrA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by AS8PR04MB7511.eurprd04.prod.outlook.com (2603:10a6:20b:23f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.13; Thu, 5 Dec 2024 16:51:34 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%4]) with mapi id 15.20.8230.010; Thu, 5 Dec 2024 16:51:34 +0000 From: Frank Li Date: Thu, 05 Dec 2024 11:51:10 -0500 Subject: [PATCH 2/5] regulator: pca9450: Use dev_err_probe() to simplify code Message-Id: <20241205-pca9450-v1-2-aab448b74e78@nxp.com> References: <20241205-pca9450-v1-0-aab448b74e78@nxp.com> In-Reply-To: <20241205-pca9450-v1-0-aab448b74e78@nxp.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robin Gong , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, joy.zou@nxp.com, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1733417480; l=5056; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=a+/tdvfNrna1Hxq1r+zVZqlrUGxbeu/wyD9Dmoa9nNQ=; b=SYZYkK/PEqkwMefZC7ZooIhhLiJ/UCY8lzC4yOl4E83iuDh923XrnTWkcwNCeTGLkAShsBAta IGSacrTzwH5D5LKTDq2HfaIRE/0vAfbCkanfgs+DT4z7IisWh0BTZQt X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR02CA0029.namprd02.prod.outlook.com (2603:10b6:a02:ee::42) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9626:EE_|AS8PR04MB7511:EE_ X-MS-Office365-Filtering-Correlation-Id: e59cf302-1fd8-4f24-6375-08dd154d1344 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message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jDasSel15HEjMpw3mOExej6sPnj6d9UmY3X4N6LrfP1HG0X1Q?= =?utf-8?q?fW4skLh+qPABr882xtiHn1QxSWxCRT17yxmbZKH3wujor7Hn9gQrVOSzAx+xY29b7?= =?utf-8?q?aK041wLD+wo6L9FL8lErcfmX7AzZfYgxHAkpifGMT4Iw88vJdl6jGbz9Vd/7FBjPT?= =?utf-8?q?+56Py8H4CKaNxUSTyiNgYCbR/ZOW6Rf3rPOBOCe05iTSa6oUS6pOWGqNLcqQQe9R8?= =?utf-8?q?AbGxFPI/v9LdKqPqa1AJyBVIxeRgiZ03MoW7aLgS2V0UeH5xwNqwjIaAM4xE5T80P?= =?utf-8?q?R/w8gOdVusuVBt2zng+aaWtv8bULV6en6p57WsqzzOPbn0mz/dUAbAO+D7qOBcwLm?= =?utf-8?q?k78OCrvdVlkYyaN++m7WVMBLHUs+DNRPR10uVKDAR4E0SQrtll50sHOqkXYlupP1Y?= =?utf-8?q?yWSMl/K7F9c2h8NW4hpcTwrW5UVCIlk0SPcH8Vh8pUOx4ux00lkq878scqmYQh9W4?= =?utf-8?q?4HRG8l9tkPbSgGCH8igKx2XeBK4gsn4RrPGw7i+Tq7jEDoz+AerXSo8=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Fx2kfAINsT7jdJ3fz9ovb6WP1VGA?= =?utf-8?q?h6sU9nsy3szm4b78BKtA3zFTORVm/0YZT7HcWnxybdUcqJyA2suoJRjCtpEaLxpxE?= =?utf-8?q?LYudjjifTIwa6Z1TLz1+s26lh4imB1RtM4cpp94TGnKDK+4+BZ/eoCWKukB0bPoj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LUE0xWlJgYc?= =?utf-8?q?VRO6KvD3EwdbBcaNVx04P+C+/uR1wy2ENF302l3JzZ2FGOd0Kn1wUuPtGrQyxP6bK?= =?utf-8?q?PFKb5pxXEgC5MyaK7BXhlolvypso+w2Q3otzeiqSZI2KG4FguTkU6n0FRrBZ/fb6R?= =?utf-8?q?WwnqQSXl95TgoHZksOjvQSTV8+Y300ZexA+6kAIYxPhSqlQ/yyUeP64IPkqFGjmjF?= =?utf-8?q?Jn/D9U2jM4f0kUGxRxdRClQinoaSDy5rNiJQkL8O75z4hb/y8kMlJqTc9tV81jBfW?= =?utf-8?q?8Qtv4yK/6xRf5rV6LMnI4UiPFs2nHaTGscxBjMpB+XFFOhwH9VW1hEnlzfhPcwcpL?= =?utf-8?q?vwaPmirejaHT0wY9OjvNekyMk0OexEln3ut3Ykji/cn02OyJOZhTROOa1eMhHU0nd?= =?utf-8?q?oQdbrvMI6mdvlTNIH3CL6nBVMjKTJLhq3l1bLkAqXEYxsCoAHR3qshE6p+Xshhacc?= =?utf-8?q?TvRHOmMMmChe2qMkwLpaMOy6bxNvVdyfr56hyFsHGYq7SX5SgxEFQ544KuSp+yfXt?= =?utf-8?q?ZVB7q8aTeQDZ?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e59cf302-1fd8-4f24-6375-08dd154d1344 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 16:51:33.9525 (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: Phmuumb5fWrRD0RqXTm4P2Jqp/Lt7lf33XkOhW7btMTgVcAll681YXW83Ox4BYD2Pc290A7hF3Bm9fE/4tQROg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7511 Use dev_err_probe() to simplify code. Signed-off-by: Frank Li --- drivers/regulator/pca9450-regulator.c | 73 +++++++++++++---------------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c index caeeed433165c..0b1f099fdd5ee 100644 --- a/drivers/regulator/pca9450-regulator.c +++ b/drivers/regulator/pca9450-regulator.c @@ -932,25 +932,20 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) pca9450->regmap = devm_regmap_init_i2c(i2c, &pca9450_regmap_config); - if (IS_ERR(pca9450->regmap)) { - dev_err(&i2c->dev, "regmap initialization failed\n"); - return PTR_ERR(pca9450->regmap); - } + if (IS_ERR(pca9450->regmap)) + return dev_err_probe(&i2c->dev, PTR_ERR(pca9450->regmap), + "regmap initialization failed\n"); ret = regmap_read(pca9450->regmap, PCA9450_REG_DEV_ID, &device_id); - if (ret) { - dev_err(&i2c->dev, "Read device id error\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, "Read device id error\n"); /* Check your board and dts for match the right pmic */ if (((device_id >> 4) != 0x1 && type == PCA9450_TYPE_PCA9450A) || ((device_id >> 4) != 0x3 && type == PCA9450_TYPE_PCA9450BC) || - ((device_id >> 4) != 0x9 && type == PCA9450_TYPE_PCA9451A)) { - dev_err(&i2c->dev, "Device id(%x) mismatched\n", - device_id >> 4); - return -EINVAL; - } + ((device_id >> 4) != 0x9 && type == PCA9450_TYPE_PCA9451A)) + return dev_err_probe(&i2c->dev, -EINVAL, + "Device id(%x) mismatched\n", device_id >> 4); for (i = 0; i < pca9450->rcnt; i++) { const struct regulator_desc *desc; @@ -964,13 +959,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) config.dev = pca9450->dev; rdev = devm_regulator_register(pca9450->dev, desc, &config); - if (IS_ERR(rdev)) { - ret = PTR_ERR(rdev); - dev_err(pca9450->dev, - "Failed to register regulator(%s): %d\n", - desc->name, ret); - return ret; - } + if (IS_ERR(rdev)) + return dev_err_probe(pca9450->dev, PTR_ERR(rdev), + "Failed to register regulator(%s)\n", desc->name); } if (pca9450->irq) { @@ -978,29 +969,24 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) pca9450_irq_handler, (IRQF_TRIGGER_FALLING | IRQF_ONESHOT), "pca9450-irq", pca9450); - if (ret != 0) { - dev_err(pca9450->dev, "Failed to request IRQ: %d\n", - pca9450->irq); - return ret; - } + if (ret != 0) + return dev_err_probe(pca9450->dev, ret, "Failed to request IRQ: %d\n", + pca9450->irq); + /* Unmask all interrupt except PWRON/WDOG/RSVD */ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_INT1_MSK, IRQ_VR_FLT1 | IRQ_VR_FLT2 | IRQ_LOWVSYS | IRQ_THERM_105 | IRQ_THERM_125, IRQ_PWRON | IRQ_WDOGB | IRQ_RSVD); - if (ret) { - dev_err(&i2c->dev, "Unmask irq error\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, "Unmask irq error\n"); } /* Clear PRESET_EN bit in BUCK123_DVS to use DVS registers */ ret = regmap_clear_bits(pca9450->regmap, PCA9450_REG_BUCK123_DVS, BUCK123_PRESET_EN); - if (ret) { - dev_err(&i2c->dev, "Failed to clear PRESET_EN bit: %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, "Failed to clear PRESET_EN bit\n"); if (of_property_read_bool(i2c->dev.of_node, "nxp,wdog_b-warm-reset")) reset_ctrl = WDOG_B_CFG_WARM; @@ -1010,20 +996,16 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) /* Set reset behavior on assertion of WDOG_B signal */ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL, WDOG_B_CFG_MASK, reset_ctrl); - if (ret) { - dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, "Failed to set WDOG_B reset behavior\n"); if (of_property_read_bool(i2c->dev.of_node, "nxp,i2c-lt-enable")) { /* Enable I2C Level Translator */ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_CONFIG2, I2C_LT_MASK, I2C_LT_ON_STANDBY_RUN); - if (ret) { - dev_err(&i2c->dev, - "Failed to enable I2C level translator\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, + "Failed to enable I2C level translator\n"); } /* @@ -1033,10 +1015,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) */ pca9450->sd_vsel_gpio = gpiod_get_optional(pca9450->dev, "sd-vsel", GPIOD_OUT_HIGH); - if (IS_ERR(pca9450->sd_vsel_gpio)) { - dev_err(&i2c->dev, "Failed to get SD_VSEL GPIO\n"); - return PTR_ERR(pca9450->sd_vsel_gpio); - } + if (IS_ERR(pca9450->sd_vsel_gpio)) + return dev_err_probe(&i2c->dev, PTR_ERR(pca9450->sd_vsel_gpio), + "Failed to get SD_VSEL GPIO\n"); dev_info(&i2c->dev, "%s probed.\n", type == PCA9450_TYPE_PCA9450A ? "pca9450a" :