From: Tzung-Bi Shih <tzungbi@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
linux-pwm@vger.kernel.org, chrome-platform@lists.linux.dev,
kernel@pengutronix.de
Subject: Re: [PATCH v3 051/108] pwm: cros-ec: Make use of devm_pwmchip_alloc() function
Date: Wed, 22 Nov 2023 16:52:44 +0800 [thread overview]
Message-ID: <ZV3BXAMCBkArwIm6@google.com> (raw)
In-Reply-To: <20231121134901.208535-52-u.kleine-koenig@pengutronix.de>
On Tue, Nov 21, 2023 at 02:49:53PM +0100, Uwe Kleine-König wrote:
> @@ -41,7 +40,7 @@ struct cros_ec_pwm {
>
> static inline struct cros_ec_pwm_device *pwm_to_cros_ec_pwm(struct pwm_chip *chip)
> {
> - return container_of(chip, struct cros_ec_pwm_device, chip);
> + return pwmchip_priv(chip);
Or just replace every `pwm_to_cros_ec_pwm` to `pwmchip_priv`.
> @@ -226,13 +225,13 @@ static const struct pwm_ops cros_ec_pwm_ops = {
> * of PWMs it supports directly, so we have to read the pwm duty cycle for
> * subsequent channels until we get an error.
> */
> -static int cros_ec_num_pwms(struct cros_ec_pwm_device *ec_pwm)
> +static int cros_ec_num_pwms(struct cros_ec_device *ec, bool use_pwm_type)
As replied in previous patch, `use_pwm_type` in the path is always false.
> @@ -261,35 +260,36 @@ static int cros_ec_pwm_probe(struct platform_device *pdev)
> struct device_node *np = pdev->dev.of_node;
> struct cros_ec_pwm_device *ec_pwm;
> struct pwm_chip *chip;
> + bool use_pwm_type = false;
> + unsigned npwm;
To be neat, `unsigned int`.
[...]
> + chip = devm_pwmchip_alloc(dev, npwm, sizeof(*ec_pwm));
> + if (IS_ERR(chip))
> + return PTR_ERR(chip);
> +
> + ec_pwm = pwm_to_cros_ec_pwm(chip);
pwmchip_priv().
next prev parent reply other threads:[~2023-11-22 8:52 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
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 [this message]
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=ZV3BXAMCBkArwIm6@google.com \
--to=tzungbi@kernel.org \
--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=u.kleine-koenig@pengutronix.de \
/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