lkml.org 
[lkml]   [2024]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/10] pwm: Add SI-EN SN3112 PWM support
Hello,

On Wed, Apr 24, 2024 at 04:55:26PM +0100, Bryan O'Donoghue wrote:
> On 24/04/2024 16:29, Xilin Wu via B4 Relay wrote:
> > +#include <linux/i2c.h>
> > +#include <linux/module.h>
> > +#include <linux/mutex.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/pwm.h>
> > +#include <linux/regmap.h>
> > +#include <linux/delay.h>
> > +#include <linux/gpio/consumer.h>
> > +#include <linux/regulator/consumer.h>
>
> Includes should be alphabetised

Also check if you need them all. (E.g. I wonder about delay.h)

> > + dev_dbg(priv->pdev, "request regmap_write 0x%x 0x%x\n", reg, val);
> > + err = regmap_write(priv->regmap, reg, val);
> > + if (err)
> > + dev_warn_ratelimited(
> > + priv->pdev,
> > + "regmap_write to register 0x%x failed: %pe\n", reg,
> > + ERR_PTR(err));
>
> Multi-line should be encapsulated in {}
>
> if (err) {
> stuff
> goes here
> }

In my eyes a single state doesn't need {} even when spanning multiple
lines.

> > + return err;
> > +}

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-05-27 18:02    [W:0.441 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site