[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGH7fHlq0Ao_Mr3U@surfacebook>
Date: Mon, 15 May 2023 12:29:32 +0300
From: andy.shevchenko@...il.com
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: netdev@...r.kernel.org, jarkko.nikula@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, mika.westerberg@...ux.intel.com,
jsd@...ihalf.com, Jose.Abreu@...opsys.com, andrew@...n.ch,
hkallweit1@...il.com, linux@...linux.org.uk,
linux-i2c@...r.kernel.org, linux-gpio@...r.kernel.org,
mengyuanlou@...-swift.com,
Piotr Raczynski <piotr.raczynski@...el.com>
Subject: Re: [PATCH net-next v8 4/9] net: txgbe: Register I2C platform device
Mon, May 15, 2023 at 02:31:55PM +0800, Jiawen Wu kirjoitti:
> Register the platform device to use Designware I2C bus master driver.
> Use regmap to read/write I2C device region from given base offset.
...
> +#include <linux/platform_device.h>
> #include <linux/gpio/property.h>
> +#include <linux/regmap.h>
Perhaps keeping this ordered?
> #include <linux/clkdev.h>
> #include <linux/clk-provider.h>
> #include <linux/i2c.h>
...
> +static const struct regmap_config i2c_regmap_config = {
> + .reg_bits = 32,
> + .val_bits = 32,
> + .reg_read = txgbe_i2c_read,
> + .reg_write = txgbe_i2c_write,
fast_io = true;
? (Note, I haven't checked if IO accessors are really fast)
> +};
...
> + i2c_regmap = devm_regmap_init(&pdev->dev, NULL, wx,
> + &i2c_regmap_config);
This is exactly a single line (80 characters), why to have two?
> + if (IS_ERR(i2c_regmap)) {
> + wx_err(wx, "failed to init regmap\n");
> + return PTR_ERR(i2c_regmap);
> + }
...
> + res = DEFINE_RES_IRQ(pdev->irq);
> + info.res = &res;
You can do
info.res = &DEFINE_RES_IRQ(pdev->irq);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists