From patchwork Mon Jan 29 15:25:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535874 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 84E2E151CF5; Mon, 29 Jan 2024 15:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541966; cv=none; b=W8g+rtiCZKQK89EXrzPzR7fAoRg/WhdVXIAHwJghlWWdD3+xYjalYnMrQF9lZyFKhNPAQtA1HZFK3tsEZBxh5LSKm3+Q7MVyRvP9cwnuCmmOpGYPOx6ciCI84zfKhf1lPxaxsT85RSk2weU03xksIogu/bcc4jkvYEycJ7qziGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541966; c=relaxed/simple; bh=E7coSRQ/lrL+zPhCt/stQdEMSwH7peEoinjsQ9l/Kyo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jhZqLRmAnVCnV1B6Al1F/vzGUHsH3T9gUan443lzxlXICE4heWMGx330d3UPnfrPHN8oLdH3wPg5Z19vFDCC0qLByo1MdRjgHWGYluwAH6277R8tFx9DQugZdut9JxPjkrAX/pteh3dt7dYMc1qCeYZYsvc55ztZ+lFSAj2lryA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=QEe42v70; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="QEe42v70" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7djL9025835; Mon, 29 Jan 2024 09:26:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=/ FvPKNYW8+69ZrZpAFPlMtLu/qoplLQuSrPYv2i/F2M=; b=QEe42v70JDh890v60 Ljn3Qdq7AT2j/FjBD1+qazzQy4x/ElR7+VQkYU++e/u1mbcZ/ea0Ks661E5h/CNC DcrKR5fSJMhJiv2rdia1mX4rTOo/YdQOkPrUJZSlrCFqwqoxXfGCJfUEk7+xzND5 r9hOCCzAeDMHeCdTP9fmqkjHTa3Kfy/NK+tUgOnjWmBk2IXqGAHWiRlSRbkSq2mO /LV8yCOYX7DaQEmesomcr1cSgBCa0gsCbVMD6do2yfc0kGvYyXWVCkiSR8QCgssP xNYNOap+6VMl/Ozm3/i56uAFV9Y6jekmciThiHWYZImFNX8zeFco+6u/DAgjLtdS GzC5g== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3vw043t6cm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:25:59 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:57 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:57 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id A8668820242; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 1/6] spi: cs42l43: Tidy up header includes Date: Mon, 29 Jan 2024 15:25:52 +0000 Message-ID: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: T1Yo4X84zz3NwzJ67FxkTfmYZRAVJ_4W X-Proofpoint-GUID: T1Yo4X84zz3NwzJ67FxkTfmYZRAVJ_4W X-Proofpoint-Spam-Reason: safe Including some missing headers. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Acked-by: Mark Brown Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/spi/spi-cs42l43.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c index f13073e12593..16b2c6c2e006 100644 --- a/drivers/spi/spi-cs42l43.c +++ b/drivers/spi/spi-cs42l43.c @@ -11,7 +11,9 @@ #include #include #include +#include #include +#include #include #include #include From patchwork Mon Jan 29 15:25:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535875 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 D90FC153BC8; Mon, 29 Jan 2024 15:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541967; cv=none; b=Ceo6CwXdYsI3cDNxthZyaYrwZXLEA8sk6mV8VgIlanZZC4ITpnfqi3vFp3uj0nvbVqAgmgEdNWDeYsI9n+T5LTw0UQoErAxnsSzU1tL3YedpDwwa9E3pAi2e0e1gS0vnVzJC3y+4zQ6WuvXJGuor3rK4ZMWzn5nlUg9A1UJkUqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541967; c=relaxed/simple; bh=q9ql3J2G31bnVEyGcYhjKqM6jXVK4yEucmGySZebKKc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fbJ++90l/KFF2mWenL5IYcFxz31gm5/eY61ag4Y2BFu2jmE9wLYzIDjYbtdftupi3YctycooHyfgn3Avj4qwfFyZIE/igYMQq+DcAuZZSsZb8/2nPG9srZyOZzEsa0XB9bThvQIgSb6CXpqMtSLeVAR3jVd8Ae90/GNUmlAkiXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=PLOhyAK2; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="PLOhyAK2" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7djLA025835; Mon, 29 Jan 2024 09:26:01 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=MdUlIFWfEbHH0r2uD5z4zRvAd9TdOSipi187X3xJiRQ=; b= PLOhyAK2suZaT9qef29CnVJSHPlecqR+XUMJJR38phEGIAkTtjxRLuX+p+3MR9Xb LGJKlnkPkr+BTlaM8cHPDpoVzOXD4IEw2NuhoiPxxZNoQUhHN0swRN1aXlxsW5rx FhqCJD6OhPXFgr8v5xjp6h1MEuMPPqzzNastLrtYSlcXR0VhIhtY7Ix+BSXFDxOu juyC1+MlaJXia6pZTzkv2gzyA29BWqCenzZlutPBO1fU12ZMCFave+cWG1k0myWT dvxCpc/gcSrmZlICaR3Mjl9NOohSnaUzji2W4SLFGX1X0V4hW9YRDQTj4VrFrD7z Xqodad6fpgFcw/b27R0Diw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3vw043t6cm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:26:00 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:57 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:57 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id B7B53820247; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 2/6] mfd: cs42l43: Tidy up header includes Date: Mon, 29 Jan 2024 15:25:53 +0000 Message-ID: <20240129152557.3221212-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> References: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: t1_ruhDGAhXiix-EVoL8KuiUiGktn8t- X-Proofpoint-GUID: t1_ruhDGAhXiix-EVoL8KuiUiGktn8t- X-Proofpoint-Spam-Reason: safe Use more forward declarations, move header guards to cover other includes, and rely less on including headers through other headers. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax --- Changes since v3: - Returned to v1 by not including pm.h and regmap.h in cs42l43.h Thanks, Charles drivers/mfd/cs42l43-i2c.c | 6 +++++- drivers/mfd/cs42l43-sdw.c | 6 +++++- drivers/mfd/cs42l43.c | 8 +++++++- drivers/mfd/cs42l43.h | 10 ++++++---- include/linux/mfd/cs42l43.h | 13 +++++++------ 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/cs42l43-i2c.c b/drivers/mfd/cs42l43-i2c.c index 4922211680c9..7162274a0b55 100644 --- a/drivers/mfd/cs42l43-i2c.c +++ b/drivers/mfd/cs42l43-i2c.c @@ -6,11 +6,15 @@ * Cirrus Logic International Semiconductor Ltd. */ +#include #include -#include #include +#include #include +#include #include +#include +#include #include "cs42l43.h" diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c index 1d85bbf8cdd5..d6962a5a35f6 100644 --- a/drivers/mfd/cs42l43-sdw.c +++ b/drivers/mfd/cs42l43-sdw.c @@ -6,11 +6,15 @@ * Cirrus Logic International Semiconductor Ltd. */ +#include #include #include -#include +#include #include +#include #include +#include +#include #include #include #include diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c index 7b6d07cbe6fc..4e2bc5ad244a 100644 --- a/drivers/mfd/cs42l43.c +++ b/drivers/mfd/cs42l43.c @@ -6,18 +6,24 @@ * Cirrus Logic International Semiconductor Ltd. */ +#include #include #include #include +#include #include -#include #include +#include #include #include +#include #include #include +#include #include +#include #include +#include #include "cs42l43.h" diff --git a/drivers/mfd/cs42l43.h b/drivers/mfd/cs42l43.h index eb4caf393833..8d1b1b0f5a47 100644 --- a/drivers/mfd/cs42l43.h +++ b/drivers/mfd/cs42l43.h @@ -6,15 +6,17 @@ * Cirrus Logic International Semiconductor Ltd. */ -#include -#include -#include - #ifndef CS42L43_CORE_INT_H #define CS42L43_CORE_INT_H #define CS42L43_N_DEFAULTS 176 +struct dev_pm_ops; +struct device; +struct reg_default; + +struct cs42l43; + extern const struct dev_pm_ops cs42l43_pm_ops; extern const struct reg_default cs42l43_reg_default[CS42L43_N_DEFAULTS]; diff --git a/include/linux/mfd/cs42l43.h b/include/linux/mfd/cs42l43.h index cf8263aab41b..2239d8585e78 100644 --- a/include/linux/mfd/cs42l43.h +++ b/include/linux/mfd/cs42l43.h @@ -6,20 +6,21 @@ * Cirrus Logic International Semiconductor Ltd. */ +#ifndef CS42L43_CORE_EXT_H +#define CS42L43_CORE_EXT_H + #include -#include -#include #include #include #include -#include #include -#ifndef CS42L43_CORE_EXT_H -#define CS42L43_CORE_EXT_H - #define CS42L43_N_SUPPLIES 3 +struct device; +struct gpio_desc; +struct sdw_slave; + enum cs42l43_irq_numbers { CS42L43_PLL_LOST_LOCK, CS42L43_PLL_READY, From patchwork Mon Jan 29 15:25:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535879 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 B4FE8155A59; Mon, 29 Jan 2024 15:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.152.168 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541976; cv=none; b=aShp6LT3i5O2IXtkxT613qgzyP6SQ8+wwe7EICwdBTrQ1L5TLf4trR8o3i2SoT46hjUocUOQ4CJdL7PNNmdrdtyQwqWYyAxU6TcK9w8RwQNSR9fq87nwUl4bXMr8ktjJf9xXvizaGiju3xA4QtoIDPcq/Qeh7GMdJ4IuW4rEJow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541976; c=relaxed/simple; bh=68yJ9U7yDOQN/tmXLFDBJ2RA3Jr4KUc5Ol0WN9miz6k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uskceqwgZAvQ1qjaP9bAvwuUE/RjBtypk31pC28nXleRIq03ZYsEsNKlwqsG9j/2XUxEi41j36v3M0LOcFSV8lXRH7duQXMymq2FpzJq3O+ihZwvs7BWwE2wDJj+aWa+4oka+bO1i6p5JUzxggNyr/Maiuq16ow594uq19lYG+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=BgFpVD/z; arc=none smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="BgFpVD/z" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T5ga4N008621; Mon, 29 Jan 2024 09:26:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=zml9ilUhvsqCAh5cH8JndKwXXuBxD+atI54RnGVm2Bk=; b= BgFpVD/z66u1pteeL5S3eYNSF7D+gSSj6+O4JgJJYoiZma7MKBdVc74pjdJVGp56 dvYrgAMLGOazp/CEpmioDsjg7GNWtYfeu7+QXz5rF0JscNmhSYzUQdlVWjnihb27 gclt8jepTECtGu2gMwSqCv3hdi0SUu7Lty/DIN/Xtigq+/MjX3++nXBoDz3xh3Xm MlUSFL5eyIDGZ56XGDrZGaOUSzo9E3P3Vp4it4NEn6xqDKoDCa6bgKsfFbDI9Zsc /KMy4cLoY5po4Z5AHR83Lztm8YZCnEGdTCdiaPPBI4WltjRIe6hGkEY3z9Jp3JhA Tz3xIqNadm6i1kQukRvE4g== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vvy4nt7ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:25:59 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id C66A4820248; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 3/6] mfd: cs42l43: Use __u8 type rather than u8 for firmware interface Date: Mon, 29 Jan 2024 15:25:54 +0000 Message-ID: <20240129152557.3221212-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> References: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: gdghCE4TGgvasgVyNJlJSWeJmIiytLmo X-Proofpoint-GUID: gdghCE4TGgvasgVyNJlJSWeJmIiytLmo X-Proofpoint-Spam-Reason: safe __xxx is the preferred type for firmware interfaces. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/mfd/cs42l43.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c index 4e2bc5ad244a..65a331481d97 100644 --- a/drivers/mfd/cs42l43.c +++ b/drivers/mfd/cs42l43.c @@ -55,8 +55,8 @@ struct cs42l43_patch_header { __le16 version; __le16 size; - u8 reserved; - u8 secure; + __u8 reserved; + __u8 secure; __le16 bss_size; __le32 apply_addr; __le32 checksum; From patchwork Mon Jan 29 15:25:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535878 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 01B26154445; Mon, 29 Jan 2024 15:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541970; cv=none; b=mCUUhgD/Vi8RYmoGECCiXkelGCuMKuc87i7tROGZyabd976QPwq6qEU9i8An2m45OcN+EHgmDU7ZYvCcnZvykq6EFWeM00t+4necdvqBM588J0CkRbjokFCxZ7OiDmrT88i5XvMEgxCrdDwUAid2IebXYeYan0I279E1U0g9ELs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541970; c=relaxed/simple; bh=CKiAuVpcuWCYAmjEC8urCO7KeSgM606DkgNL4PFpxp0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Uztf/kS/7qwwGU0cm5kL/SNcJz9Jofr9H66cHeXLS536KFRrIpEVpiUkdVHG7sqAxFrC7gEnAqGoMn2tjjdqZ207dH4LcWDcawQy0vlZT5MpdAvGp+zCLlPBCXiOILmx8njpqpm0NknerZABKs35dlZv4MR7Hn8/DR8wTJXTzsQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=QHEGtXlN; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="QHEGtXlN" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7djLC025835; Mon, 29 Jan 2024 09:26:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=MKe/ZKuo42udzJM5kAcMNa+xCm0W8JLyaeSAAF25GQc=; b= QHEGtXlNLMfOmxKp6pGaemb8V77hUy6VUyIX1DAEAIvLjiNhMw9VVv4iVCG2YL0q gep28bs8W7Uyvj2iQOv/5h6mwtJQpzS3WoOgHFM4S5/erQ1ehVlphNWPaA9NqrI7 f9e2cYCa6mdu01yXRuroSEw+Aiz2WzyFb1sXKTnP27jrsClK3BKXLje+40+kYI4i SBvOfwvGhUZ72HMk+6LVal+y9xWK49bKGthZHvsDFSox717+reUI8HODUjbht41j EnKfNY92kfQvUbJsNwwNcIE+OdjjPDhCsEtkN6GzS4c4GfHqCr5KTjHAs+HYem9N aiWNSV0lkHHDlOIJvXiq1w== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3vw043t6cm-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:26:03 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id D2DE2820249; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 4/6] mfd: cs42l43: Add time postfixes on defines Date: Mon, 29 Jan 2024 15:25:55 +0000 Message-ID: <20240129152557.3221212-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> References: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: hqN7fv8vPOWCAe2L_otHQiTmTNxNDusS X-Proofpoint-GUID: hqN7fv8vPOWCAe2L_otHQiTmTNxNDusS X-Proofpoint-Spam-Reason: safe Make the defines a little clearer by adding time based postfixes. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/mfd/cs42l43.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c index 65a331481d97..aea0f8f48578 100644 --- a/drivers/mfd/cs42l43.c +++ b/drivers/mfd/cs42l43.c @@ -27,30 +27,30 @@ #include "cs42l43.h" -#define CS42L43_RESET_DELAY 20 +#define CS42L43_RESET_DELAY_MS 20 -#define CS42L43_SDW_ATTACH_TIMEOUT 500 -#define CS42L43_SDW_DETACH_TIMEOUT 100 +#define CS42L43_SDW_ATTACH_TIMEOUT_MS 500 +#define CS42L43_SDW_DETACH_TIMEOUT_MS 100 #define CS42L43_MCU_BOOT_STAGE1 1 #define CS42L43_MCU_BOOT_STAGE2 2 #define CS42L43_MCU_BOOT_STAGE3 3 #define CS42L43_MCU_BOOT_STAGE4 4 -#define CS42L43_MCU_POLL 5000 -#define CS42L43_MCU_CMD_TIMEOUT 20000 +#define CS42L43_MCU_POLL_US 5000 +#define CS42L43_MCU_CMD_TIMEOUT_US 20000 #define CS42L43_MCU_UPDATE_FORMAT 3 #define CS42L43_MCU_UPDATE_OFFSET 0x100000 -#define CS42L43_MCU_UPDATE_TIMEOUT 500000 +#define CS42L43_MCU_UPDATE_TIMEOUT_US 500000 #define CS42L43_MCU_UPDATE_RETRIES 5 #define CS42L43_MCU_SUPPORTED_REV 0x2105 #define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200 #define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001 -#define CS42L43_VDDP_DELAY 50 -#define CS42L43_VDDD_DELAY 1000 +#define CS42L43_VDDP_DELAY_US 50 +#define CS42L43_VDDD_DELAY_US 1000 -#define CS42L43_AUTOSUSPEND_TIME 250 +#define CS42L43_AUTOSUSPEND_TIME_MS 250 struct cs42l43_patch_header { __le16 version; @@ -538,10 +538,10 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43) regcache_cache_only(cs42l43->regmap, true); regmap_multi_reg_write_bypassed(cs42l43->regmap, reset, ARRAY_SIZE(reset)); - msleep(CS42L43_RESET_DELAY); + msleep(CS42L43_RESET_DELAY_MS); if (cs42l43->sdw) { - unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_DETACH_TIMEOUT); + unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_DETACH_TIMEOUT_MS); unsigned long time; time = wait_for_completion_timeout(&cs42l43->device_detach, timeout); @@ -561,7 +561,7 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43) static int cs42l43_wait_for_attach(struct cs42l43 *cs42l43) { if (!cs42l43->attached) { - unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_ATTACH_TIMEOUT); + unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_ATTACH_TIMEOUT_MS); unsigned long time; time = wait_for_completion_timeout(&cs42l43->device_attach, timeout); @@ -603,7 +603,7 @@ static int cs42l43_mcu_stage_2_3(struct cs42l43 *cs42l43, bool shadow) ret = regmap_read_poll_timeout(cs42l43->regmap, CS42L43_BOOT_STATUS, val, (val == CS42L43_MCU_BOOT_STAGE3), - CS42L43_MCU_POLL, CS42L43_MCU_CMD_TIMEOUT); + CS42L43_MCU_POLL_US, CS42L43_MCU_CMD_TIMEOUT_US); if (ret) { dev_err(cs42l43->dev, "Failed to move to stage 3: %d, 0x%x\n", ret, val); return ret; @@ -652,7 +652,7 @@ static int cs42l43_mcu_disable(struct cs42l43 *cs42l43) ret = regmap_read_poll_timeout(cs42l43->regmap, CS42L43_SOFT_INT_SHADOW, val, (val & CS42L43_CONTROL_APPLIED_INT_MASK), - CS42L43_MCU_POLL, CS42L43_MCU_CMD_TIMEOUT); + CS42L43_MCU_POLL_US, CS42L43_MCU_CMD_TIMEOUT_US); if (ret) { dev_err(cs42l43->dev, "Failed to disable firmware: %d, 0x%x\n", ret, val); return ret; @@ -696,7 +696,7 @@ static void cs42l43_mcu_load_firmware(const struct firmware *firmware, void *con ret = regmap_read_poll_timeout(cs42l43->regmap, CS42L43_SOFT_INT_SHADOW, val, (val & CS42L43_PATCH_APPLIED_INT_MASK), - CS42L43_MCU_POLL, CS42L43_MCU_UPDATE_TIMEOUT); + CS42L43_MCU_POLL_US, CS42L43_MCU_UPDATE_TIMEOUT_US); if (ret) { dev_err(cs42l43->dev, "Failed to update firmware: %d, 0x%x\n", ret, val); cs42l43->firmware_error = ret; @@ -957,7 +957,7 @@ static int cs42l43_power_up(struct cs42l43 *cs42l43) } /* vdd-p must be on for 50uS before any other supply */ - usleep_range(CS42L43_VDDP_DELAY, 2 * CS42L43_VDDP_DELAY); + usleep_range(CS42L43_VDDP_DELAY_US, 2 * CS42L43_VDDP_DELAY_US); gpiod_set_value_cansleep(cs42l43->reset, 1); @@ -973,7 +973,7 @@ static int cs42l43_power_up(struct cs42l43 *cs42l43) goto err_core_supplies; } - usleep_range(CS42L43_VDDD_DELAY, 2 * CS42L43_VDDD_DELAY); + usleep_range(CS42L43_VDDD_DELAY_US, 2 * CS42L43_VDDD_DELAY_US); return 0; @@ -1057,7 +1057,7 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43) if (ret) return ret; - pm_runtime_set_autosuspend_delay(cs42l43->dev, CS42L43_AUTOSUSPEND_TIME); + pm_runtime_set_autosuspend_delay(cs42l43->dev, CS42L43_AUTOSUSPEND_TIME_MS); pm_runtime_use_autosuspend(cs42l43->dev); pm_runtime_set_active(cs42l43->dev); /* From patchwork Mon Jan 29 15:25:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535877 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 69221153BD1; Mon, 29 Jan 2024 15:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541969; cv=none; b=TcTDT36xaQvAPrWrzgMFWX/LEnVXTwfIRXbr36Dnwi7x4dMi2yKk3POmH6UkUBrrfsdB40ywjMv/pphvWK+VaPYs31SqiQsWc5m8uTAKd90QLCP/TksWztQdWnHOu4XF4cAiWK8jaLZx917EQwmtYVQjgKq8iRULbNVekUf0hY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541969; c=relaxed/simple; bh=YLgcv+MksptIyuKoYuQwWHnWo1FWh5tVnpSCXF8cu5I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MG8VTCmh6K4CkfV0ADlKCm8KEOm6q6YFdmWQV7CSMnY7j6kBW8cTCjmihinwILBd7cj2bcDAMIxlMJzZ4S+dgXdlkJ5lGhroA+Etkg5CPH+O7kqeju7pdUsNWlc0B/tl3isM+X/ArL6GiFtqpjL1eHi4gM7Z70GYpM7rPWa7tIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=FnLpyXIN; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="FnLpyXIN" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7djLD025835; Mon, 29 Jan 2024 09:26:04 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=jv3N4/orHK/tu+hqh1ucmB1KxC83pTKued3P6djDN/g=; b= FnLpyXINzo/1628IRcVUYvafxA+djw02t+1i/+GktF6K5P8orrEdtu2/E5YNU+VD meMqSPsRbioiZEQawSwQiylX+i1L4jApI80eISAg2Hbuq3twaZ7a+KQ65D4QApxr d8BumFPSsAQo4JrdqaO1Lt098VipkBoOcHVGHXDbHYfdaqOL3q+EweYX7TUXMbZm NanzvUeVZ+4LABXRzmHHiLqTb6cpmpd/AEZwhIClArhARA8MUim9l/yDugSZglx+ UaG/u1ftfz+fnjSVEebaB3po6UguPADMZxFZnw//f6TH0YOEii4sazd6XiC/4vpf Pbafd1XAiYkEx4QUuvNg0Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3vw043t6cm-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:26:03 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id DC34B82024A; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 5/6] mfd: cs42l43: Add some missing dev_err_probe()s Date: Mon, 29 Jan 2024 15:25:56 +0000 Message-ID: <20240129152557.3221212-5-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> References: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: RsjHCOk4fFS9ASlWM_hBTbS3r9vQpI1C X-Proofpoint-GUID: RsjHCOk4fFS9ASlWM_hBTbS3r9vQpI1C X-Proofpoint-Spam-Reason: safe Use of dev_err_probe() was missed in the i2c and sdw parts of the code, update the missing parts. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/mfd/cs42l43-i2c.c | 9 +++------ drivers/mfd/cs42l43-sdw.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/cs42l43-i2c.c b/drivers/mfd/cs42l43-i2c.c index 7162274a0b55..c9e4ea76149a 100644 --- a/drivers/mfd/cs42l43-i2c.c +++ b/drivers/mfd/cs42l43-i2c.c @@ -38,7 +38,6 @@ static const struct regmap_config cs42l43_i2c_regmap = { static int cs42l43_i2c_probe(struct i2c_client *i2c) { struct cs42l43 *cs42l43; - int ret; cs42l43 = devm_kzalloc(&i2c->dev, sizeof(*cs42l43), GFP_KERNEL); if (!cs42l43) @@ -50,11 +49,9 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c) cs42l43->attached = true; cs42l43->regmap = devm_regmap_init_i2c(i2c, &cs42l43_i2c_regmap); - if (IS_ERR(cs42l43->regmap)) { - ret = PTR_ERR(cs42l43->regmap); - dev_err(cs42l43->dev, "Failed to allocate regmap: %d\n", ret); - return ret; - } + if (IS_ERR(cs42l43->regmap)) + return dev_err_probe(cs42l43->dev, PTR_ERR(cs42l43->regmap), + "Failed to allocate regmap\n"); return cs42l43_dev_probe(cs42l43); } diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c index d6962a5a35f6..65f7b1d78248 100644 --- a/drivers/mfd/cs42l43-sdw.c +++ b/drivers/mfd/cs42l43-sdw.c @@ -171,7 +171,6 @@ static int cs42l43_sdw_probe(struct sdw_slave *sdw, const struct sdw_device_id * { struct cs42l43 *cs42l43; struct device *dev = &sdw->dev; - int ret; cs42l43 = devm_kzalloc(dev, sizeof(*cs42l43), GFP_KERNEL); if (!cs42l43) @@ -181,11 +180,9 @@ static int cs42l43_sdw_probe(struct sdw_slave *sdw, const struct sdw_device_id * cs42l43->sdw = sdw; cs42l43->regmap = devm_regmap_init_sdw(sdw, &cs42l43_sdw_regmap); - if (IS_ERR(cs42l43->regmap)) { - ret = PTR_ERR(cs42l43->regmap); - dev_err(cs42l43->dev, "Failed to allocate regmap: %d\n", ret); - return ret; - } + if (IS_ERR(cs42l43->regmap)) + return dev_err_probe(cs42l43->dev, PTR_ERR(cs42l43->regmap), + "Failed to allocate regmap\n"); return cs42l43_dev_probe(cs42l43); } From patchwork Mon Jan 29 15:25:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 13535876 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 D724A153BC9; Mon, 29 Jan 2024 15:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541968; cv=none; b=gZS4hWLfeZq3zDp6joIEQyPOfajbTNnG8C4Zs70ge5x+vhp7qUeNvCAqplP5/ygBh4kIrduOFTMc11JurDi7rU3alHNOB1NleZyS9tt3IFTar2gu20E9ktt3Eeh/TpvTMDuZ0fsnWOYbk7Ggp/2MNGA7dWCPLZ5D565VFnenEyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541968; c=relaxed/simple; bh=uextZG18CzeHYosFxOcQP1oHXcr2tHoI1P2JYMBpwOo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tpkTo8egQKehK+OLkbr8SXZyUMdhNj2fQDhTTRzrO1ZrabSoFDYSb3UaXbENF+uyzXDdH1DjrJPpSS3Vf2ruuUyFRAJAOCrUYYLatHYms6eI/+G2vB8XR02ax8cbzc1XYwjCe8aKvKIDyB5IJljyQjYRXLH9UbPlZc+vt+wJ6I8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=fLZbES1M; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="fLZbES1M" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7djLB025835; Mon, 29 Jan 2024 09:26:02 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=bzna3m2lCyDt7gWuC49hdp+iE8dDF02eQ7l4YbiEaVw=; b= fLZbES1MkjombToWj1tRRXfZ7c6oCcNunHPwS0ifSsNml5smZmlNXVVoUksMpcnM 3PmCYLXBdHW04AlpwCdfrs8YKEe4B2YNMN2rBrsUDleT1VdxZ+Wmx59tIsbUbEY0 ez2G7vlvMA2EWhD0u3VAOtYyakCv84FJQ4xjpaNGjzMT2idCHOAzhzX/liEWhpCD 8RamX9PtuyYZYBUHQNMb3U9S8/81nBmcH8Igo+As3KaYturY0gSjxGCxxROjaqLl koer5Cbqti0FfQp9j/E4cJ+9HDaKGEVKXrDX4Iy6/ZdLJGz40UIGZspblVA84tMp OXslkCbN2FCtucZQa05rNA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3vw043t6cm-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 09:26:02 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 15:25:58 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id DE98382024B; Mon, 29 Jan 2024 15:25:57 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v4 6/6] mfd: cs42l43: Handle error from devm_pm_runtime_enable() Date: Mon, 29 Jan 2024 15:25:57 +0000 Message-ID: <20240129152557.3221212-6-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> References: <20240129152557.3221212-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: lq35Qk5_4SYx_f9w3qLhGjaSA4o3rwpX X-Proofpoint-GUID: lq35Qk5_4SYx_f9w3qLhGjaSA4o3rwpX X-Proofpoint-Spam-Reason: safe As it devm_pm_runtime_enable() can fail due to memory allocations, it is best to handle the error. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/mfd/cs42l43.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c index aea0f8f48578..56bd9dbbe10b 100644 --- a/drivers/mfd/cs42l43.c +++ b/drivers/mfd/cs42l43.c @@ -1065,7 +1065,9 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43) * the boot work runs. */ pm_runtime_get_noresume(cs42l43->dev); - devm_pm_runtime_enable(cs42l43->dev); + ret = devm_pm_runtime_enable(cs42l43->dev); + if (ret) + return ret; queue_work(system_long_wq, &cs42l43->boot_work);