Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp998537rdb; Wed, 24 Jan 2024 01:22:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjK9yRD5XJ/RfhTxIAMPIeD5H+FDhRu2fiLpYhiqxFR4AJsVn2iKDZkxoxi9FzaZjueLGV X-Received: by 2002:a05:6402:207c:b0:55a:fffe:4455 with SMTP id bd28-20020a056402207c00b0055afffe4455mr887529edb.92.1706088179805; Wed, 24 Jan 2024 01:22:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706088179; cv=pass; d=google.com; s=arc-20160816; b=ObX2Vhs1kcOGJjlcA9hNjaCHGiP2lTweiLHlhWEWKAhzCd50+dH2QUAYtp9n0pI91J AQf2hNxtGBVJmeckAXTV+GxWd3n3bK9/9+P/TZ94aiwWVRG4n1qF++qes3ujQuStWFSt BpteXZh6Fxci5p6rN7CpOyBwc8ph8hHZVdK4lTNatnFHbp79b69GaWMqp2LNm45w38a8 cPAts8jjJTjnMRPu63aMPWzhAV/s7UzK/qg9aDmIAfm3Evh5koGTCL+jACGbbVRmTEHx c5k+TdNjrmMkU9WE3tsJg7MnhfCoRK4x1T6YaP+HFOBhh9KzqbXOw0HfT+7xfOfvBzqh bXSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:dkim-signature; bh=XKfrsIh+is/CrcG9RcsWASRz9/Tq/yuaNYUtRHDrGYY=; fh=H3U0xlt7goOSAhUb4NN7kdWef7Oh5ZGxLLtPcSBLg6k=; b=eltI99L/4V4GaYNkdWlQzGs4z4MeMd2HWc1wPTg9d4/k+XeVhi0F59s1zsi4enBDKJ +TlG0LXsT9qG0iz/Eb83A3/RUHmAPHk01+qUY+MZt65Xx4ldIEzNwBVhVNAkwCDSIpeQ Mxippgfxt7gLuQaDFGP07Z1wcRa7DX9/HawOBfgkNARI7mJtoyAT0e64hX1TO3Is3IqU iH7EX87qQACm60W1F0yQKWSDNDJVWIpNQ25e+2Z2wWThMqKX69KNLxOwVmxACjl0Mmxw zXaC8wI0iyKPKwpVzuMW6SrU1ly/kSgkWQjoN2JOKX/GAgdQQ2lkgDOBdUNo8nYW86Zs UU3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=lNPdkd1a; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-36698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36698-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 6-20020a508e06000000b0055a62d4707esi5410991edw.624.2024.01.24.01.22.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=lNPdkd1a; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-36698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36698-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C00A51F24516 for ; Wed, 24 Jan 2024 09:21:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CFE2182DA; Wed, 24 Jan 2024 09:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="lNPdkd1a" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E640418036 for ; Wed, 24 Jan 2024 09:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706088013; cv=none; b=UGvcW/HruVZEpLw8hwMBdxP/soy+8k5jL4MMaRVPfGWBJu4TcGbKAxSofjou4bi6wmvbqX4ND7HO5ISoSF4U4btpFtYLVSdEyj+ItBj80YW41NRQyvSPLWM851/5uG57ORteJEsuwUNt7hzS5zSf8aNOPwpm3ICZD2tzCVYH0n4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706088013; c=relaxed/simple; bh=SEqCpZT6APAqjYjHdfthclsSjN9J9NtcFcgDByg6704=; h=References:From:To:Cc:Subject:Date:In-reply-to:Message-ID: MIME-Version:Content-Type; b=mIxA0fzD/+94E+ts1kUPaG5Za66PUie9Yl8WhIVVHgM9WIqcrBoBqK4UTUV4nbxr5Gj1Y/mhekx/cZuTgwJ08IhG661n0lyUeADaY06VbIHwGK7RawN94S87VcOVGcipyU5SRUNK8R2LZPzrRO9p9/lzhMC7ulRY3MFejbtK5V4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=lNPdkd1a; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2cdf69bb732so56794391fa.3 for ; Wed, 24 Jan 2024 01:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706088010; x=1706692810; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=XKfrsIh+is/CrcG9RcsWASRz9/Tq/yuaNYUtRHDrGYY=; b=lNPdkd1ar7PFVviCpzhXDewaVecUKlLnzjPk3HY9rmPz59I/WszYxTx6SG1hoInhWf NMDDJ2kISFP7DNQk7x+JsHcomdQ/UrL3VPCrY7jsqwau8sprZShZ5ZLwfynfXCkpGRY9 IqAJKpuFgvKbpraglPjNItwmJFG8NgIWv/S+HhNwAmOuVHuwYdP26RPGT3qP4TbaS37a A6DWoc/cyK1dhjrcj0MI84jXqnqatCxK5ZgtPXUYckNRi2WnjhFOW/NrKjSrFtFnHt/v m0EtZakTWAtFUDnXOCMKW2AZfLCfG7E2yvS0PrbOHoAKvSjPnCqW7X0WH6DZdpdet6v0 cQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706088010; x=1706692810; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=XKfrsIh+is/CrcG9RcsWASRz9/Tq/yuaNYUtRHDrGYY=; b=fvaHHS3MPQMZjowPTNDOXQaumQ0dIds5Qzh+fJ8ERrRsozNyQZK4AB8rHlypPoPpBk htqfvIlYh5dM87A18EF6lVLHhhcsJmTQ1DE6pOns1Mmsy3W4c/PdfkrPvu3Nd3PT5QQ0 bt39bu5EEKBeoS05L/9eUWkibP0wZXITKuJo/MCHAL4kV/Le1M/TLa/zBKtYs7TYO6sr JJQVWM7A6npqcvURfiV+pXr+mQ78GbQbT98mFMHTXFlEbSgUXI4EOPslqseuc6EglVHb zxIu3a9iQ9gZurDdlsrKUj6l3Jndx6s0T0KyUQMnEgTmwdyDK4Mo4ixGM+qwaPWvCpkq ltaw== X-Gm-Message-State: AOJu0YxTjFGuJvv1t2lg2pmlQGGDGVEvaEScXY+agVM9dE7lpgQMbaIl eu8fzDjJl8Bc5rIPL23zlRIK8inF+dL5I7akpVpjkJ1nsj+ujQMvU5D/X/+uOao= X-Received: by 2002:a2e:9c95:0:b0:2cd:5cfd:b13 with SMTP id x21-20020a2e9c95000000b002cd5cfd0b13mr332903lji.17.1706088009899; Wed, 24 Jan 2024 01:20:09 -0800 (PST) Received: from localhost ([2a01:e0a:3c5:5fb1:d8b6:17b6:386f:c67b]) by smtp.gmail.com with ESMTPSA id bw12-20020a0560001f8c00b00337cef427f8sm15938313wrb.70.2024.01.24.01.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:20:09 -0800 (PST) References: <20231222111658.832167-1-jbrunet@baylibre.com> <20231222111658.832167-6-jbrunet@baylibre.com> User-agent: mu4e 1.10.8; emacs 29.1 From: Jerome Brunet To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Jerome Brunet , Thierry Reding , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-pwm@vger.kernel.org, JunYi Zhao Subject: Re: [PATCH v4 5/6] pwm: meson: don't carry internal clock elements around Date: Wed, 24 Jan 2024 10:16:17 +0100 In-reply-to: Message-ID: <1jttn3w0ja.fsf@starbuckisacylon.baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed 24 Jan 2024 at 10:02, Uwe Kleine-K=C3=B6nig wrote: > [[PGP Signed Part:Undecided]] > On Fri, Dec 22, 2023 at 12:16:53PM +0100, Jerome Brunet wrote: >> Pointers to the internal clock elements of the PWM are useless >> after probe. There is no need to carry this around in the device >> data. Just let devres deal with it. >>=20 >> Signed-off-by: Jerome Brunet >> --- >> drivers/pwm/pwm-meson.c | 67 ++++++++++++++++++++++++----------------- >> 1 file changed, 39 insertions(+), 28 deletions(-) >>=20 >> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c >> index 15c44185d784..fb113bc8da29 100644 >> --- a/drivers/pwm/pwm-meson.c >> +++ b/drivers/pwm/pwm-meson.c >> @@ -90,9 +90,6 @@ struct meson_pwm_channel { >> unsigned int hi; >> unsigned int lo; >>=20=20 >> - struct clk_mux mux; >> - struct clk_divider div; >> - struct clk_gate gate; >> struct clk *clk; >> }; >>=20=20 >> @@ -442,6 +439,13 @@ static int meson_pwm_init_channels(struct device *d= ev) >> struct meson_pwm_channel *channel =3D &meson->channels[i]; >> struct clk_parent_data div_parent =3D {}, gate_parent =3D {}; >> struct clk_init_data init =3D {}; >> + struct clk_divider *div; >> + struct clk_gate *gate; >> + struct clk_mux *mux; >> + >> + mux =3D devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL); >> + if (!mux) >> + return -ENOMEM; > > I don't like this change. While it doesn't increase the memory used, it > fragments the used memory and increases the overhead of memory > management and the number of devm allocations. > > Are these members of meson_pwm_channel in the way for anything later? Not really. It is just not useful on the SoCs which do use it and not used at all starting from s4/a1. What about a dedicated struct for the 3 clock elements and a single devm_kzalloc() instead of 3 ?=20 > > Best regards > Uwe --=20 Jerome