[PATCH v2 2/6] pwm: pxa: add optional reset control
Uwe Kleine-König
ukleinek at kernel.org
Thu Apr 24 00:30:40 PDT 2025
Hello,
On Sun, Apr 20, 2025 at 03:02:47PM +0800, Guodong Xu wrote:
> @@ -49,10 +50,10 @@ MODULE_DEVICE_TABLE(platform, pwm_id_table);
> #define PWMDCR_FD (1 << 10)
>
> struct pxa_pwm_chip {
> - struct device *dev;
> -
> - struct clk *clk;
> - void __iomem *mmio_base;
> + struct device *dev;
> + struct clk *clk;
> + void __iomem *mmio_base;
> + struct reset_control *reset;
Changes like these are the reason I prefer to not align the member
names. Luckily reset is a write only variable and you can just drop this
hunk if you use a local variable for it in pwm_probe() below.
> };
>
> static inline struct pxa_pwm_chip *to_pxa_pwm_chip(struct pwm_chip *chip)
> @@ -179,6 +180,11 @@ static int pwm_probe(struct platform_device *pdev)
> if (IS_ERR(pc->clk))
> return PTR_ERR(pc->clk);
>
> + pc->reset = devm_reset_control_get_optional_exclusive_deasserted(
> + &pdev->dev, NULL);
> + if (IS_ERR(pc->reset))
> + return PTR_ERR(pc->reset);
> +
> chip->ops = &pxa_pwm_ops;
>
> if (IS_ENABLED(CONFIG_OF))
Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20250424/9d82d426/attachment.sig>
More information about the linux-riscv
mailing list