From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 E01AC5B5D3; Thu, 25 Jan 2024 14:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706192081; cv=none; b=lGVWNjeLYCZo+dH4/FUaF3uNtu7SKGH49ejT2b6JdL9fnWR5qwGmBvuUPMqtJtRM+hhHWZp9hHsuucqifrhDhglDixzEWlFXMBJpg6AzMZOG8hVBXcph6OqK3RGwrtvsSaTva6Bm707z/DytK31ohaeSjCcqqZSwb+czhwcSlrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706192081; c=relaxed/simple; bh=xuWotEzSelSVBqWujYKbIOXX960an6aLcCPwqSUkjtM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tuhY37Y1Q0s291OOZVZY8I/LCr+s92HoPZ28EIeFJOnG1jhSuxVj+7fqAP8vHMs3NPPUevdXBUD93k2KfSsmakanmLptsjTD1sXkYeu8RpRc8pRT0j24HuOQoWlkxBZ2LghapMWAJDhNixpQ2yhH+22GGbdmftEQIue9rWIQtvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=nSMrqxBc; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="nSMrqxBc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1706192078; bh=xuWotEzSelSVBqWujYKbIOXX960an6aLcCPwqSUkjtM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nSMrqxBc5B0zoxSh7oM+5Fjyr3Ev/UxHPkW05LIh9tqvVs8PD+gCaNAqlz5QsrhBH HbSRK9bawmsg86dsQH2IjMpDCUePRyRF5oM8aEVzAti4uMMz1HRIpPYLi32u2KBQJ+ AliVBErnUM3jUPU81ZHJPCNYmhPMgUeAyPCVcAL4Hih1LBsQ2CGmIALnpwgLpButSL rbFGcAbYC6BY3TnD/ujgbQgo1zc9++xbkTUK6KOdcjliB5wx4T3j9bIncv2DioZft3 9ALNYJlMlexd763yE/DkmWdIt93ZLBCvhepEUEmz9UsnHPTMiD95fyECCAAuyLjyhN 8xG5LCL5+b38A== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 3B7E43782057; Thu, 25 Jan 2024 14:14:35 +0000 (UTC) Message-ID: <4079a650-74a6-49bc-87a9-c5729fb6e8d1@collabora.com> Date: Thu, 25 Jan 2024 15:14:35 +0100 Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 003/111] pwm: Provide a macro to get the parent device of a given chip Content-Language: en-US To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , linux-pwm@vger.kernel.org, Claudiu Beznea , Nicolas Ferre , Alexandre Belloni , Florian Fainelli , Ray Jui , Scott Branden , Benson Leung , Shawn Guo , Sascha Hauer , Paul Cercueil , Matthias Brugger , Neil Armstrong , Kevin Hilman , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Fabrice Gasnier , Maxime Coquelin , Alexandre Torgue , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andrzej Hajda , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Broadcom internal kernel review list , Guenter Roeck , chrome-platform@lists.linux.dev, Fabio Estevam , NXP Linux Team , linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, Jerome Brunet , Martin Blumenstingl , linux-amlogic@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, Alim Akhtar , linux-samsung-soc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, Douglas Anderson , Laurent Pinchart , Jonas Karlman , dri-devel@lists.freedesktop.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev References: <1cae6f73264ab313205eaa9483251f7aaf259cb4.1706182805.git.u.kleine-koenig@pengutronix.de> From: AngeloGioacchino Del Regno In-Reply-To: <1cae6f73264ab313205eaa9483251f7aaf259cb4.1706182805.git.u.kleine-koenig@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 25/01/24 13:08, Uwe Kleine-König ha scritto: > Currently a pwm_chip stores in its struct device *dev member a pointer > to the parent device. Preparing a change that embeds a full struct > device in struct pwm_chip, this accessor macro should be used in all > drivers directly accessing chip->dev now. This way struct pwm_chip and > this macro can be changed without having to touch all drivers in the > same change set. > > Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno > --- > include/linux/pwm.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/pwm.h b/include/linux/pwm.h > index 8ffe9ae7a23a..d7966918f301 100644 > --- a/include/linux/pwm.h > +++ b/include/linux/pwm.h > @@ -289,6 +289,11 @@ struct pwm_chip { > struct pwm_device *pwms; > }; > > +static inline struct device *pwmchip_parent(struct pwm_chip *chip) > +{ > + return chip->dev; > +} > + > #if IS_ENABLED(CONFIG_PWM) > /* PWM user APIs */ > int pwm_apply_might_sleep(struct pwm_device *pwm, const struct pwm_state *state);