Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp287713lqp; Wed, 12 Jun 2024 01:15:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrOW/rh2pg89w38FCZiOzIMpfgciZEsBvMs4YL3K94wERz2cJ2ndkXvI1J88DEk0+sz4hasVdWynWIJDk2/v+wRwNjvw1xxVZXImPsFQ== X-Google-Smtp-Source: AGHT+IFE21paeRnihZqZ376u2DZ6ixhE1qNrNlslQC5KAfEFEELXWrwWmqTxPVup9pL8taj26FYl X-Received: by 2002:a17:902:ce0e:b0:1f8:415d:40eb with SMTP id d9443c01a7336-1f8415d4263mr10131085ad.25.1718180143617; Wed, 12 Jun 2024 01:15:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718180143; cv=pass; d=google.com; s=arc-20160816; b=qoPsbkaraCK7FlLpKtFG2Jtjb3RqTmPQfOcBfBNIODIysIGgG63NYMPCwAOdrklmG5 McK9No94OkH3mea880R1l4bnnk4IsLMPqDHZQe1z0MAm8wUzjT94/ByYJijCGS07k4xf s6f+cPBKNg0Woo424yhQs+Vtb3uD3ZnQX5Jv4i5HdIL0qDTgvoXrsf57ucNm+B+rEvkh /l1/R17nIkTa7/1JIfmrHz8oZ88AobEz5aj2KBju6IjIDtG33dw2oI1g4DhNrUb/WRLl va0LAgclKWA2RjR1CDRFjJG/aV7UoGmjkL9W3X9/ylt5NX4poV/dD9NCdH88EKN7Wywm 4kxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=2i7JgKL6b8AoADzVvoe4uoGCOL76aOnzRK1ZmUzoPt0=; fh=/lfBx7DtUiVpBPxJ44Fcvp4EvK1gLdyyLzlp6ocg4gY=; b=R/k2aGRV2zXXhpiOeE0MStGZMDelKl/2KyzR/yOoE/dEorD+JC3IrGLOMOselTHyka GNDG+qEMFyxYB7QRfN7MTxuV6O2FzSIWOk+zZNS6GmSUq6swElbir6i06YIb68O4Tses X3q54jDLWdf0s0n3lAAMGUmQYLzcuqqdY7J/PDRV0W0I3gWXJMXQS0texTb4hPn+bglf aNFIg5LxSGRoM0yZgAdIPsKFGXTYL8rqKSOQg8EM828JgMbDaHFCMoCgq/txZXmoO7qB fricaZTAMJY5ISrprFhxWRAKcb7IMTOhXQLARdJ9wI2/nrkwuPhugND36bL2TtE30Tzp Af3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=NI1FLGzG; 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-211158-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211158-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f718217b07si47835735ad.108.2024.06.12.01.15.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211158-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=NI1FLGzG; 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-211158-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211158-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 37F4F281562 for ; Wed, 12 Jun 2024 08:15:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DAF416C87F; Wed, 12 Jun 2024 08:15:26 +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="NI1FLGzG" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 682F51FB5 for ; Wed, 12 Jun 2024 08:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180125; cv=none; b=oORILIY1nBjwFNbQSwRGJCv+h+FfhMMFtiyhgF8Ljip85RBVouJF/kcEvxO92AiicCmXjduKcRIUXkSUWNcwas0mFngNlrgM5jpAs2Duwe8KjZj/fYQvyUud9FGcw2mdOQyak6xLZhsRo7weWJPHtiJUFRIAldxCKR/U1F+Y+CE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180125; c=relaxed/simple; bh=8ZjoDG6AdLp9DrAUpZbOs5O/3KdItU+ylOPmYLZXOLc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=WhX58jisYFLfIDo95kUSpG8AM9YfPMIO2kHbVzbViJWguUQJaOzoYuETVyZMDGVwWhSQKz7VXhaxq9Z1QYFEbXRYqY3KBRoAVrycevtOr+4zN+Gv/qmQq4OFtUdsqotVvsqJh2EC/RNFvJQDTl9E5pgzzAyUnipmZ+1PCqZD7pM= 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=NI1FLGzG; arc=none smtp.client-ip=209.85.167.53 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-lf1-f53.google.com with SMTP id 2adb3069b0e04-52c819f6146so2438395e87.1 for ; Wed, 12 Jun 2024 01:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718180120; x=1718784920; darn=vger.kernel.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2i7JgKL6b8AoADzVvoe4uoGCOL76aOnzRK1ZmUzoPt0=; b=NI1FLGzGksABEF/A5IBK52wMjY8CJyqLkjnvtJqyTn1DjdlJFJ6KFV165lA0TQlZCv dmKJRZijKHoGLZomhpGjajW971W9l6spnzlf9ilPYil6T0MtMCfWs8inCBRw8M8Cb4D3 RCMUdBvRbGuhhHlZ8xrMVQAxNL4shbaI2fRIiSsvREjGy5XZZmQNHR5RFnbpZZJeuRhA la3G5K9mgX/QAU2tITpaSWHDgunqQYwFhnF6JCekGSy6sRmQFU0CLIMdwW4ka/kGrWZy 7+UdM40q3rSCf3FVv9L0QXRi+kEfBhPf4uPhzWDDwJFsO23iwshm9wF4ORkshpcsEg7H Bg3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718180120; x=1718784920; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2i7JgKL6b8AoADzVvoe4uoGCOL76aOnzRK1ZmUzoPt0=; b=osza8MExAZ8YqI+wmBhfhqyxSLsIB9amx9zlzr2Hn6Xaw4VpzqX5fnhgemLkFc4HEH /37N3EFySIOmhmcNFOH+SoVaz93pT4H1Ng22rxhf9eJjdSrfIvMzfJkWz8zCfCTYORGD L46Qtgn06WFkA0EfM1X+A4e95b3yo6WLbXHIjrVCvdJqKCuOeclIejjmYyDGnlSMhCF5 vo0pWnPCpDCbMnPYUM3jp51zuXeSjTvtO8WvFxyhPbwsSkpFT3NIEYkE+XAH9g0OdS/7 mbsdk+ILa/uHz2u/FF8uk2hDqTjC1WEMqnxauo9rz2sXyG0QLLAH2U95QVtZBQgbcK/8 /xwQ== X-Forwarded-Encrypted: i=1; AJvYcCUNIQkTA1IsMemjhIF2vgfs6LIJ626eNDb1eX4ilnhVdppPR2g58hv4bquPjKa71MPWd0uy+t4ywf8ipxx3eJMXlMF3T+Kp2lu+/5K/ X-Gm-Message-State: AOJu0YxwJbeiCHCsQ2t24qNX/z6rMF2KgWD0sbkjkYWZM2mjiJqR+Z0L YVcr7iqT2h1xUbdE4IcuNZ6h1tFshnjEnEkf9jA5T4Jf2grWHp3P06pHuWuRaoM= X-Received: by 2002:a2e:7c19:0:b0:2eb:d924:43fb with SMTP id 38308e7fff4ca-2ebfc92c231mr6922271fa.41.1718180120393; Wed, 12 Jun 2024 01:15:20 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:9163:6ed9:3c9a:d6c9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42286eefa07sm15947595e9.8.2024.06.12.01.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:15:19 -0700 (PDT) From: Jerome Brunet To: George Stark Cc: , Rob Herring , Krzysztof Kozlowski , Martin Blumenstingl , Kevin Hilman , Neil Armstrong , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Conor Dooley , , , , , , Junyi Zhao Subject: Re: [DMARC error][DKIM error] [PATCH v7 1/2] pwm: meson: Add support for Amlogic S4 PWM In-Reply-To: (George Stark's message of "Wed, 5 Jun 2024 15:12:54 +0300") References: <20240605-s4-pwm-v7-0-e822b271d7b0@amlogic.com> <20240605-s4-pwm-v7-1-e822b271d7b0@amlogic.com> Date: Wed, 12 Jun 2024 10:15:19 +0200 Message-ID: <1jikyek25k.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 On Wed 05 Jun 2024 at 15:12, George Stark wrote: > Hello Kelvin, Junyi > > On 6/5/24 05:44, Kelvin Zhang via B4 Relay wrote: >> From: Junyi Zhao >> Add support for Amlogic S4 PWM. >> Signed-off-by: Junyi Zhao >> Signed-off-by: Kelvin Zhang >> --- >> drivers/pwm/pwm-meson.c | 36 ++++++++++++++++++++++++++++++++++++ >> 1 file changed, 36 insertions(+) >> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c >> index b2f97dfb01bb..4f01847525b2 100644 >> --- a/drivers/pwm/pwm-meson.c >> +++ b/drivers/pwm/pwm-meson.c >> @@ -460,6 +460,34 @@ static int meson_pwm_init_channels_meson8b_v2(struct pwm_chip *chip) >> return meson_pwm_init_clocks_meson8b(chip, mux_parent_data); >> } >> +static void meson_pwm_s4_put_clk(void *data) >> +{ >> + struct clk *clk = data; >> + >> + clk_put(clk); >> +} >> + >> +static int meson_pwm_init_channels_s4(struct pwm_chip *chip) >> +{ >> + struct device *dev = pwmchip_parent(chip); >> + struct device_node *np = dev->of_node; >> + struct meson_pwm *meson = to_meson_pwm(chip); >> + int i, ret; >> + >> + for (i = 0; i < MESON_NUM_PWMS; i++) { >> + meson->channels[i].clk = of_clk_get(np, i); >> + if (IS_ERR(meson->channels[i].clk)) { >> + ret = PTR_ERR(meson->channels[i].clk); >> + dev_err_probe(dev, ret, "Failed to get clk\n"); >> + return ret; >> + } >> + devm_add_action_or_reset(dev, meson_pwm_s4_put_clk, >> + meson->channels[i].clk); > > devm_add_action_or_reset() result should be checked > >> + } >> + >> + return 0; >> +} > > You can rewrite it a bit to always have a single allocation for devm node: > > static void meson_pwm_s4_put_clk(void *data) > { > struct meson_pwm *meson = data; > int i; > > for (i = 0; i < MESON_NUM_PWMS; i++) > clk_put(meson->channels[i].clk); > } This has already been discussed on v6. This make the code un-necessarily complex and potentially put clock that have not even been claimed. > > static int meson_pwm_init_channels_s4(struct pwm_chip *chip) > { > struct device *dev = pwmchip_parent(chip); > struct device_node *np = dev->of_node; > struct meson_pwm *meson = to_meson_pwm(chip); > int i, ret; > > ret = devm_add_action(dev, meson_pwm_s4_put_clk, meson); > if (ret) > return ret; > > for (i = 0; i < MESON_NUM_PWMS; i++) { > meson->channels[i].clk = of_clk_get(np, i); > if (IS_ERR(meson->channels[i].clk)) { > ret = PTR_ERR(meson->channels[i].clk); > dev_err_probe(dev, ret, "Failed to get clk\n"); > return ret; > } > } > > return 0; > } -- Jerome