chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: linux-pwm@vger.kernel.org, chrome-platform@lists.linux.dev,
	Thierry Reding <thierry.reding@gmail.com>,
	kernel@pengutronix.de, Guenter Roeck <groeck@chromium.org>,
	Benson Leung <bleung@chromium.org>
Subject: Re: [PATCH v3 001/108] pwm: cros-ec: Change prototype of helper to prepare further changes
Date: Thu, 23 Nov 2023 10:24:31 +0100	[thread overview]
Message-ID: <20231123092431.4xcvbccjrbid7ius@pengutronix.de> (raw)
In-Reply-To: <ZV3BQMalgY7WZCVR@google.com>

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

On Wed, Nov 22, 2023 at 04:52:16PM +0800, Tzung-Bi Shih wrote:
> On Tue, Nov 21, 2023 at 02:49:03PM +0100, Uwe Kleine-König wrote:
> > @@ -233,7 +232,7 @@ static int cros_ec_num_pwms(struct cros_ec_pwm_device *ec_pwm)
> >  
> >  	/* The index field is only 8 bits */
> >  	for (i = 0; i <= U8_MAX; i++) {
> > -		ret = cros_ec_pwm_get_duty(ec_pwm, i);
> > +		ret = cros_ec_pwm_get_duty(ec_pwm->ec, ec_pwm->use_pwm_type, i);
> 
> Or just pass false for `use_pwm_type` because the path:
> cros_ec_pwm_probe()
> -> !ec_pwm->use_pwm_type
> -> cros_ec_num_pwms()
> 
> `ec_pwm->use_pwm_type` is always false here.

Good catch, that allows to simplify the patch that introduces
devm_pwmchip_alloc() to this driver.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-11-23  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 13:49 [PATCH v3 000/108] pwm: Fix lifetime issues for pwm_chips Uwe Kleine-König
2023-11-21 13:49 ` [PATCH v3 001/108] pwm: cros-ec: Change prototype of helper to prepare further changes Uwe Kleine-König
2023-11-22  8:52   ` Tzung-Bi Shih
2023-11-23  9:24     ` Uwe Kleine-König [this message]
2023-11-21 13:49 ` [PATCH v3 008/108] pwm: cros-ec: Make use of pwmchip_parent() macro Uwe Kleine-König
2023-11-22  8:52   ` Tzung-Bi Shih
2023-11-21 13:49 ` [PATCH v3 051/108] pwm: cros-ec: Make use of devm_pwmchip_alloc() function Uwe Kleine-König
2023-11-22  8:52   ` Tzung-Bi Shih
2023-11-22 23:56     ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231123092431.4xcvbccjrbid7ius@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).