From: like@awinic.com
To: krzysztof.kozlowski@linaro.org
Cc: broonie@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org,
lgirdwood@gmail.com, liangdong@awinic.com, like@awinic.com,
linux-kernel@vger.kernel.org, liweilei@awinic.com,
robh+dt@kernel.org, wangweidong.a@awinic.com
Subject: Re: [PATCH V1 1/2] regulator: aw37503: add regulator driver for AWINIC AW37503
Date: Fri, 28 Jul 2023 03:19:43 +0000 [thread overview]
Message-ID: <20230728031943.1479106-1-like@awinic.com> (raw)
In-Reply-To: <284e464a-85dc-f07b-27f8-fda516ca7b24@linaro.org>
Hello Krzysztof Kozlowski,
Thank you very much for your advice.
> On 26/07/2023 10:16, like@awinic.com wrote:
> > From: Alec Li <like@awinic.com>
> >
> > Add regulator driver for the device AWINIC AW37503 which is single
> > inductor - dual output power supply device. AW37503 device is
> > designed to support general positive/negative driven applications
> > like TFT display panels.
> >
>
> Thank you for your patch. There is something to discuss/improve.
>
>
> > +
> > +static int aw37503_probe(struct i2c_client *client)
> > +{
> > + struct device *dev = &client->dev;
> > + struct aw37503_regulator *chip;
> > + struct regulator_dev *rdev;
> > + struct regmap *regmap;
> > + struct regulator_config config = { };
> > + int id;
> > + int ret;
> > +
> > + chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
> > + if (!chip)
> > + return -ENOMEM;
> > +
> > + regmap = devm_regmap_init_i2c(client, &aw37503_regmap_config);
> > + if (IS_ERR(regmap)) {
> > + ret = PTR_ERR(regmap);
> > + dev_err(dev, "regmap init failed: %d\n", ret);
> > + return ret;
>
> return dev_err_probe
I will modify it as suggested.
> > + }
> > +
> > + i2c_set_clientdata(client, chip);
> > + chip->dev = dev;
> > +
> > + for (id = 0; id < AW37503_MAX_REGULATORS; ++id) {
> > + config.regmap = regmap;
> > + config.dev = dev;
> > + config.driver_data = chip;
> > +
> > + rdev = devm_regulator_register(dev, &aw_regs_desc[id],
> > + &config);
> > + if (IS_ERR(rdev)) {
> > + ret = PTR_ERR(rdev);
> > + dev_err(dev, "regulator %s register failed: %d\n",
> > + aw_regs_desc[id].name, ret);
> > + return ret;
>
> return dev_err_probe will be easier
I will modify it as suggested.
> > + }
> > + }
> > + return 0;
> > +}
> > +
> > +static const struct i2c_device_id aw37503_id[] = {
> > + {.name = "aw37503",},
> > + {},
> > +};
> > +MODULE_DEVICE_TABLE(i2c, aw37503_id);
> > +
> > +static const struct of_device_id aw37503_dt_ids[] = {
> > + {.compatible = "awinic,aw37503",},
> > + { /* Sentinel */ },
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, aw37503_dt_ids);
> > +
> > +static struct i2c_driver aw37503_i2c_driver = {
> > + .driver = {
> > + .name = "aw37503",
> > + .of_match_table = of_match_ptr(aw37503_dt_ids),
>
> Drop of_match_ptr()
I will modify it as suggested.
Best regards,
Alec Li
next prev parent reply other threads:[~2023-07-28 3:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 8:16 [PATCH V1 0/2] " like
2023-07-26 8:16 ` [PATCH V1 1/2] " like
2023-07-26 11:16 ` Krzysztof Kozlowski
2023-07-28 3:19 ` like [this message]
2023-07-26 11:41 ` Mark Brown
2023-07-28 3:20 ` like
2023-07-26 20:13 ` Christophe JAILLET
2023-07-28 3:20 ` like
2023-07-26 8:16 ` [PATCH V1 2/2] regulator: aw37503: add device-tree binding like
2023-07-26 10:52 ` Rob Herring
2023-07-28 3:18 ` like
2023-07-26 11:15 ` Krzysztof Kozlowski
2023-07-28 3:19 ` like
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=20230728031943.1479106-1-like@awinic.com \
--to=like@awinic.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=liangdong@awinic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liweilei@awinic.com \
--cc=robh+dt@kernel.org \
--cc=wangweidong.a@awinic.com \
/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
all inboxes | Powered by JetHome®