From patchwork Thu Jan 25 10:25:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 766316 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 4AE971CA84; Thu, 25 Jan 2024 10:26:02 +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=1706178363; cv=none; b=LXfjzTMyiFNFN46neXmr5p8JKzArxAIA6bNO6d7Leent8Wj8HfWvSOAHEH/YblUB8I76V7AFwxAi5r5bDCUbfHMM25I+mPSfRNGufT3MZATDtlZRjmsKWv2ovDqZv2NS/irNkuus4NZVa+EAq6RBilUEufN47PKyZYeqvpouDxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178363; c=relaxed/simple; bh=ADL6EEUd16TWoEirfUXHF7UrKKLkYyngvp1UHT/BuGA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=knbwtZsmUG2xBomgvghAScz7JSs8sGiFA48JP49nDZ478e4oDKA1rEAFf0v0DCyYhjMYHgJZO5bCuvh5fy9QdpyTd00eLDWz0syOLy+McLOfhvD2w1zFfMGCpVrZSulq+oZW9DDdBxJGQle6qXWRYYdt4/mefTUAbKlbZdeX41I= 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=MoQKyPCe; 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="MoQKyPCe" 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 40P7paSN014010; Thu, 25 Jan 2024 04:25:57 -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=Q W01UQTD20P8CqBxFTRKQQwM25ERFOAQZUxt044R47k=; b=MoQKyPCeHpoLItGPx eah2szKYE21lONRS1Iu9LPh5Ary0AET+v/NXGjrbrKTYyfsKjrGaNFMrkVA+/qsF FPaydmCfYlqqY9jjKi/v7NPhsJtz0lkg51jdcdpuR0b6aMYvIw6iw4rdkDkmHZyR k++KOEjTs/xWESQ8f3PB7EimEIX3H6MaJeGEyqIWBFGlcSer0YD9hTR0gJzOJguS q/vgWwIMpMYUQwtOecIopRcZ/72SQjf3gFHWbP3taGx/01TFV6MzyrBBHrITtEL8 H1lQVd0ok9qFII+CHtn67M3sqIdMwkCVIvgKg2uoufOQ+I+f7jfq2jZvRJ+IuBAx 25zFw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04:25:57 -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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 50250820246; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 1/6] spi: cs42l43: Tidy up header includes Date: Thu, 25 Jan 2024 10:25:50 +0000 Message-ID: <20240125102555.2621736-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-GUID: A1islOW7n7jO12Zs_UFZL2kq9edDRCJK X-Proofpoint-ORIG-GUID: A1islOW7n7jO12Zs_UFZL2kq9edDRCJK 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 changes since v2. 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 d239fc5a49ccc..fb62807fc991c 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 Thu Jan 25 10:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 766315 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 4AEB61CA85; Thu, 25 Jan 2024 10:26:02 +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=1706178364; cv=none; b=B9teKNA/NOycEpHN67I8Dg615veC240Ph9TMda8fFO+uq/BHF0gJYMTMubueNuLYk+ovTOYuAoH3O3IQIqB4k+gt1y9ayW1rR9zveVoUPmy9jziVlyaWqYbNZ7PsgYDFVoHvUl2yHWIe4KbUiL+REqbr/AW4hPATOuKFZ5EB82I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178364; c=relaxed/simple; bh=h64B4Jysj120NFVqsEz9rAYExohizXd5EBkLaCHZXzA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CdfeXsPvHB3xfZst/eeU3OFz61+bpd2B4CUQoTZ0DE2quJHC8aWd/d/Iy9+46ivWoKbwAHx6HFXM6xtC/Qo4/wvD1SAl05rsU9OFx8TFROZU/6DibJz27oEy98TslLwEzdpiPpYuHlNG36C4goC+X5HI8TbHCBFuCqKWNtLCuHs= 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=HV/nonW+; 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="HV/nonW+" 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 40P7paSO014010; Thu, 25 Jan 2024 04:25:58 -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=tgZbg7s/Xmp8FdDn7TgrjKWKHPIok2Iqw7axQOHNlMM=; b= HV/nonW+oGdI8zJSDjn7oq3fQO/T/ZU4xzzQcSrsSeUqLqTAwd7Gb5wHkTOX0n2X x0J2ta02xtBSZRcUZu2xleGX4Ub2GJRpcDvHJo2yJxIjnaWb3N081czQNpChNR4/ jeepnr5dC0LoUS/CNRePZHyPC0cUPfICrtwtkkwEDo6dJEh/l2mqWbHlzLY8YVpH cQPhKExaccJgoCrfeT31dGZWfCt4gyDqPT2uQSpiQP8TukAHviZWJQzftRUsfVZI E/7Dx5d/CLKHqPcwDl31yf50R+VBwOPV8XTlKZgbXKC4nFm9PANayq0e/mmi7nFn G1WcS5pwwmMRgJSuN0/Z6Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04:25:57 -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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 5DAD9820247; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 2/6] mfd: cs42l43: Tidy up header includes Date: Thu, 25 Jan 2024 10:25:51 +0000 Message-ID: <20240125102555.2621736-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240125102555.2621736-1-ckeepax@opensource.cirrus.com> References: <20240125102555.2621736-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-GUID: tn-o0PeWwAAjmCuXt3tXH5RH0hsorDEi X-Proofpoint-ORIG-GUID: tn-o0PeWwAAjmCuXt3tXH5RH0hsorDEi 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 Signed-off-by: Charles Keepax Reviewed-by: Andy Shevchenko --- Changes since v2: - Added pm.h and regmap.h back into mfd/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 4922211680c96..7162274a0b551 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 1d85bbf8cdd5d..d6962a5a35f65 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 7b6d07cbe6fc6..4e2bc5ad244a5 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 eb4caf3938332..aded994b7046b 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 +#include +#include + #define CS42L43_N_DEFAULTS 176 +struct cs42l43; +struct device; + 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 cf8263aab41bd..2239d8585e785 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 Thu Jan 25 10: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: 767369 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 4AF021CA89; Thu, 25 Jan 2024 10:26:02 +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=1706178363; cv=none; b=Em+S5J60Ro0UdmojqWibZqoWaixQzJLaVLuRDnMxN4mJpqpWnalijrTdC+EKhCToqsqo/mX+9xf+pB98GV2TG9URpQEasE04o95uFTP5C8D6PCjduUrXwJ/b5jRQMHF4T4FK5AnSAF2aB2IUT/ow/15fMo/Tx5NXFZyJV6UrfbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178363; c=relaxed/simple; bh=BEttsqLbcUyK3w162SKyOK745deef5Q2OPdj/eMcPrY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=euy1m41AZVSN3lL+FpIxW07RqdL3ywNYIPKUYfo1QmUtZSIcpjDz0z0oCvw+v+kf4YN+dCZS1G82wumLQiOQ5g4oACYUoFnrr7Jv/AjRZxpBCB816hba6p8N5+G6gezTVmsHc1ZfrAvEAKr4dgoZNZou3ZZ7kBi93kzrSGlOhTY= 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=a2+rNiR2; 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="a2+rNiR2" 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 40P5wLPi008959; Thu, 25 Jan 2024 04:25:57 -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=BbjFLNhhtTIKjqslX2nvALzEiP9LMfzdDYmUGzUJ0Ik=; b= a2+rNiR21VqtwVNavHO7edBek6kMKNtX26c1o55A/L6yBQuJnRNjkYfxgp2ndEeM 4V0KFgMbQE3ip9ueQDuaN4j8ZDQPbMZdxWUMV+M2y1q51Y/lMmO8J8mD9M0ATPxI dhR5oQFtM3gN0z8pPtNV1M0rh2LVBY3t5EtWW4MxwYzRrHmhVbYfgN5xblyCU3D0 7KeNbmqjvforCmvOUZigtS1TSSmXWBvVE9GaTOM04ca5n2TX/I/73Zg7mvSpPgvS pg5fcbuPOy91Q7WC7JJrS1yPKwC4jaWEbNVx7T1Smbyvenavp1rbtaSRPPKNhgKC drgYN5J5W37GrBH2mMkp7g== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04:25:57 -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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 6BC77820248; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 3/6] mfd: cs42l43: Use __u8 type rather than u8 for firmware interface Date: Thu, 25 Jan 2024 10:25:52 +0000 Message-ID: <20240125102555.2621736-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240125102555.2621736-1-ckeepax@opensource.cirrus.com> References: <20240125102555.2621736-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-GUID: 6X2tCGW-h7n2-mGCHK_b6qsl4yDSojIe X-Proofpoint-ORIG-GUID: 6X2tCGW-h7n2-mGCHK_b6qsl4yDSojIe X-Proofpoint-Spam-Reason: safe __xxx is the preferred type for firmware interfaces. Suggested-by: Andy Shevchenko Signed-off-by: Charles Keepax --- Changes since v2: - Added commit message 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 4e2bc5ad244a5..65a331481d975 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 Thu Jan 25 10: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: 767368 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 4AF201CA8B; Thu, 25 Jan 2024 10:26:02 +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=1706178364; cv=none; b=X8EEK87jY8011MCvgAQNxyFMYohVZVVTs4Dq6rZoB877bPz4Vz2P882Lq0b4Bu0/CFC/iPb9VzzdmlotTVpylSgve0wEkGGIoXocrgew/lKKTJPuhP6g2CgoAFh+B3UK67d93/vwVNdcXcPkeR2NXpEXxnQtLArCgWUHH9cKIUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178364; c=relaxed/simple; bh=FhrQu4P7Pyl6ih2qG7uPBbK2EyAGBDkiGEBxb6FF2Rk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f0WiQ8oq1svikWRv9sINw6R0qRQ6gLK/Ps1u2lxGknzIAMscO3qy0H6vqN9N0RxrAoRuy30DYNliY7Sjbzn3A6igj7Qzv4t7QljIcfe/uOlkKmzyLKt5nYsMDZNOwuIizkTk5RMugmIbZuHHtGB7LwsO39uefjvRjN/2oCSuQ4A= 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=Oyo6mKg5; 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="Oyo6mKg5" 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 40P5wLPj008959; Thu, 25 Jan 2024 04:25:57 -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=d9674b95+6fyGE2L2nKtZskhha/Bhx67EejM1M1FwsU=; b= Oyo6mKg5fP9KoxpCnvB0XPEbBHfJ//GsZ95qpgHLW24nsa47R+gVLKAs00Y6ZhUl GKj5K67TVHLA6qE6k9yL+d80kF+Yz+XGA7g0S3bLXbUYoRi4K9HMB9AFQXuLNB+7 wEni8m9tjEY3Jg63gD4Odv9hlmZ2YYLMY2onlaqWN2m078LQJYjfVOrc/UOqZu/j TOHyNnp+fvPcMaIzU4Kc6foeCdeYPw008d8ZRHQIqzr3+087olzzqC+mXJNgF9q5 0l4PHwdAQ5muXxy7Nh9nggNqUv6SSlCQWWr5mYem9DKwIzaxwprX+Ig4kmxTG5Cd OqTgSjSVnwrNJRvba5k4UA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04:25:57 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) 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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 77EC9820249; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 4/6] mfd: cs42l43: Add time postfixes on defines Date: Thu, 25 Jan 2024 10:25:53 +0000 Message-ID: <20240125102555.2621736-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240125102555.2621736-1-ckeepax@opensource.cirrus.com> References: <20240125102555.2621736-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-GUID: 0nwn1clTtiwiEjDtc-rDNaR7d7MQtMje X-Proofpoint-ORIG-GUID: 0nwn1clTtiwiEjDtc-rDNaR7d7MQtMje X-Proofpoint-Spam-Reason: safe Suggested-by: Andy Shevchenko Signed-off-by: Charles Keepax --- No changes since v2. 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 65a331481d975..aea0f8f485785 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 Thu Jan 25 10: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: 766314 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 9F7251CA8D; Thu, 25 Jan 2024 10:26:02 +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=1706178364; cv=none; b=AvYDHaaVLKKGYuW+8rTBMG3JmecNKL1J8v3tKunreMThqRmJ6LxRWkqqsmNn5QC3qMm0hzYWWY7zbupmZgDQlAewqxITXQS8+vZgppQ1yP+Sc2cS9K7+qNtHzStWSq7kkdYD+o5oslVjjeo6KR+72oILxnIIxHL1b+/+JbrKi2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178364; c=relaxed/simple; bh=t62XeC0sIkJTMObk34vpixyT5zAm6lF6NKRpesJWxNU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jk96s0rMZQFJhs2+GkYL4IXIc4PLoRzVXfU5KwUH+zMhhbyFnZNP2MPk1fHD4+hNOUqLTWJPKWpJ9eM9gjwTPnH0JxBQF3BLcvZE463uFRXfITfN8hfPTSwsksECZ32Wric2RDpZdR6cgL7zgtylkaPbhMSXiPyBF27HRnGLMDE= 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=mxPiAgwQ; 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="mxPiAgwQ" 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 40P7paSP014010; Thu, 25 Jan 2024 04:25:58 -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=j90Mf6OkRSzIU7rEhMFiV0AA6YyW5HkH5qDLq7dYUq4=; b= mxPiAgwQpqvEyYfZvyQworPmtBDUJOCe8K7VcV6qXNr4WVp8Fv+AWgsRErWGM8s2 sqiLagvUtCH+4biGI+wCNbisbZ0UhfFats4X53HdtlL2ZdWG8DCQXOy/N6ucNgmq m8NfkpaETBAmnzLIR8b9arUS4QQdnJxB4L21tRepPhIEh8MaQ0fdPjgExNrj6Xum 2zILntRMDJOp0cxtNPcibP4++rq79bh5hLA6pf/MtYxj/bN+R2p3wIBeD8OCAZCg Fs0qVCxnPCqhNk6tZh5CMHXCHUFb7YNmcMtPpV5rdvsXqnG49MDBZfDs55Rx+Ep8 QpdSsvj1+JjZoZrTvFqBPg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gh-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04:25:58 -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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 84DDD82024A; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 5/6] mfd: cs42l43: Add some missing dev_err_probe()s Date: Thu, 25 Jan 2024 10:25:54 +0000 Message-ID: <20240125102555.2621736-5-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240125102555.2621736-1-ckeepax@opensource.cirrus.com> References: <20240125102555.2621736-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-GUID: T9mzWiA5OUZ5Nu-OMIbXlIU_Uh41-Fey X-Proofpoint-ORIG-GUID: T9mzWiA5OUZ5Nu-OMIbXlIU_Uh41-Fey 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 Signed-off-by: Charles Keepax --- Changes since v2: - Added brackets in the commit message for functions 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 7162274a0b551..c9e4ea76149a8 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 d6962a5a35f65..65f7b1d782486 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 Thu Jan 25 10: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: 767367 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 431FC1CA8E; Thu, 25 Jan 2024 10:26:03 +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=1706178364; cv=none; b=mJutFWFHIivbCiAueR8iLhl0jmYLr3ELNvUdvZnTot9k/HTNWf4DTt5EJmI7DdGYNlrIdmWsy6QMfF3QELzIz8XN43fLup0XYuzHEgjxxS61CoZLF459tzqOjVnIB8h2PAoIF959vb3sIJf+XnhACYgWV4Ii2LKJZz5RwYcp8Nw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706178364; c=relaxed/simple; bh=w4dg95HncjAo56RiG38BZGd3Pzu7W8glNY+mUdjX5F0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ge/c2T+bOOjDaRpd6QTZv5EWC8VIJrE7G+76SraNZYK+T7pGXi5egpzY2yaEuWZwhszHiGEbbxIWya0+8qBhqhil1yBkB3QZBpl/lvFRnbSw+gl+Xne0lSVfH8cba6AIIlgLWS/EhlrV0leOXCqFphhmtDk48D5RZEhmPCAhxfY= 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=UaIUHbnr; 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="UaIUHbnr" 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 40P7paSQ014010; Thu, 25 Jan 2024 04:25:59 -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=FLv7KEn1hB6G5vu93/SxG16lAdj5fv2FDse9aetjLWg=; b= UaIUHbnrCAIrFSGmVpG13iFn+U/x+c5KTHL4uklV3VsGuXeGEmk1CwHE8a4wIjDJ 1mg6ufhYYtya5UK/mlSoIuxrJ9HUtXITzaUSGtaG5+BV0c+5swBCF0YKiyYt2jD9 bFTpEu4zymk8uOnH2FkUuaUmFRPrTGhUOoZ225ybXszMDZYjlCe6QE21sGLxo3Nl CDmbCESUa1S+gJi7AELWOvmdkE5BxMQ35VXAUeWyqJIgghv3HCdGpaz2hFnV8kQb IMOHaMkQiwApZOUvtWQcm+YRrNyfd7Ts4aD8H2mgHXiDO1H/rxUjnq/DI3Uyf6Lr 2gKUClBe1vdXEQtmZ+nEXg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3vtmf9t2gh-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 04: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; Thu, 25 Jan 2024 10:25:55 +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; Thu, 25 Jan 2024 10:25:55 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 8785882024B; Thu, 25 Jan 2024 10:25:55 +0000 (UTC) From: Charles Keepax To: , CC: , , , Subject: [PATCH v3 6/6] mfd: cs42l43: Handle error from devm_pm_runtime_enable() Date: Thu, 25 Jan 2024 10:25:55 +0000 Message-ID: <20240125102555.2621736-6-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240125102555.2621736-1-ckeepax@opensource.cirrus.com> References: <20240125102555.2621736-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-GUID: nE-1YVLqE_zLrdwjYugUTb51CZuhJ-UK X-Proofpoint-ORIG-GUID: nE-1YVLqE_zLrdwjYugUTb51CZuhJ-UK 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 Signed-off-by: Charles Keepax --- No changes since v2. 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 aea0f8f485785..56bd9dbbe10b0 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);