All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sahin, Okan" <Okan.Sahin@analog.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	ChiYuan Huang <cy_huang@richtek.com>,
	"Bolboaca, Ramona" <Ramona.Bolboaca@analog.com>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	William Breathitt Gray <william.gray@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: RE: [PATCH v3 3/5] drivers: regulator: Add ADI MAX77541/MAX77540 Regulator Support
Date: Tue, 31 Jan 2023 09:27:48 +0000	[thread overview]
Message-ID: <MN2PR03MB516865804044A798AEB5B6C0E7D09@MN2PR03MB5168.namprd03.prod.outlook.com> (raw)
In-Reply-To: <MN2PR03MB5168EC97926AB33D4D806FCCE7D09@MN2PR03MB5168.namprd03.prod.outlook.com>


Hi Andy,

Sorry for second question. I do not want to bother you, but I realized that I need to be sure about driver_data before sending new patch. You said that you need to use pointers directly for driver_data then I fixed that part in mfd, but I do not need or  use driver_data in regulator since chip_id comes from mfd device so I think using like below should be enough for my implementation.

static const struct platform_device_id max77541_regulator_platform_id[] = {
	{ "max77540-regulator", },
	{ "max77541-regulator", },
	{  /* sentinel */  }
};
MODULE_DEVICE_TABLE(platform, max77541_regulator_platform_id);

static const struct of_device_id max77541_regulator_of_id[] = {
	{ .compatible = "adi,max77540-regulator", },
	{ .compatible = "adi,max77541-regulator", },
	{ /* sentinel */  }
};
MODULE_DEVICE_TABLE(of, max77541_regulator_of_id);

What do you think?

On Tue, Jan 31, 2023 at 10:21 AM +0300, Okan Sahin wrote:

>Hi Andy,
>
>Thank you for your feedback and efforts. I have a question below.
>
>On Wed, 18 Jan 2022 11:20 AM
>Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
>>On Wed, Jan 18, 2023 at 09:38:10AM +0300, Okan Sahin wrote:
>>> Regulator driver for both MAX77541 and MAX77540.
>>> The MAX77541 is a high-efficiency step-down converter with two 3A
>>> switching phases for single-cell Li+ battery and 5VDC systems.
>>>
>>> The MAX77540 is a high-efficiency step-down converter with two 3A
>>> switching phases.
>>
>>...
>>
>>> + * Copyright (c) 2022 Analog Devices, Inc.
>>
>>Happy New Year!
>>
>>...
>>
>>> +static int max77541_regulator_probe(struct platform_device *pdev) {
>>> +	struct max77541 *max77541 = dev_get_drvdata(pdev->dev.parent);
>>> +	struct regulator_config config = {};
>>> +	const struct regulator_desc *desc;
>>> +	struct device *dev = &pdev->dev;
>>
>>You may rearrange this a bit
>>
>>	struct max77541 *max77541 = dev_get_drvdata(dev->parent);
>>
>>> +	struct regulator_dev *rdev;
>>> +	int i;
>>
>>> +	config.dev = pdev->dev.parent;
>>
>>dev->parent
>>
>>> +
>>> +	if (max77541->id == MAX77540)
>>> +		desc = max77540_regulators_desc;
>>> +	else if (max77541->id == MAX77541)
>>> +		desc = max77541_regulators_desc;
>>> +	else
>>> +		return -EINVAL;
>>> +
>>> +	for (i = 0; i < MAX77541_MAX_REGULATORS; i++) {
>>
>>> +		rdev = devm_regulator_register(dev,
>>> +					       &desc[i], &config);
>>
>>This is perfectly one line.
>Thank you, I will arrange it.
>>
>>> +		if (IS_ERR(rdev))
>>> +			return dev_err_probe(dev, PTR_ERR(rdev),
>>> +					     "Failed to register regulator\n");
>>> +	}
>>> +
>>> +	return 0;
>>> +}
>>
>>...
>However, this one is not fit when I set max-line-length argument as 80 in
>checkpatch script. What do you suggest? This line has 99 characters.
>>
>>> +static const struct of_device_id max77541_regulator_of_id[] = {
>>> +	{
>>> +		.compatible = "adi,max77540-regulator",
>>> +		.data = (void *)MAX77540,
>>> +	},
>>> +	{
>>> +		.compatible = "adi,max77541-regulator",
>>> +		.data = (void *)MAX77541,
>>> +	},
>>> +	{ /* sentinel */  }
>>
>>As pointed out, better to use pointers directly.
>>
>>> +};
>>
>>--
>>With Best Regards,
>>Andy Shevchenko
>>
>
>Regards,
>Okan Sahin

Regards,
Okan


  reply	other threads:[~2023-01-31  9:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  6:38 [PATCH v3 0/5] Add MAX77541/MAX77540 PMIC Support Okan Sahin
2023-01-18  6:38 ` [PATCH v3 1/5] drivers: mfd: Add ADI " Okan Sahin
2023-01-18  8:16   ` Andy Shevchenko
2023-01-19 14:27     ` Lee Jones
2023-01-19 15:06       ` Andy Shevchenko
2023-01-19 15:06       ` William Breathitt Gray
2023-01-18  6:38 ` [PATCH v3 2/5] dt-bindings: mfd: Add ADI MAX77541/MAX77540 Okan Sahin
2023-01-18  8:22   ` Krzysztof Kozlowski
2023-01-31 12:02     ` Sahin, Okan
2023-01-31 16:44       ` Krzysztof Kozlowski
2023-01-31 21:28         ` Sahin, Okan
2023-02-01  7:25           ` Krzysztof Kozlowski
2023-02-01  7:46             ` Sahin, Okan
2023-02-01  8:08               ` Krzysztof Kozlowski
2023-01-18 13:10   ` Rob Herring
2023-01-18  6:38 ` [PATCH v3 3/5] drivers: regulator: Add ADI MAX77541/MAX77540 Regulator Support Okan Sahin
2023-01-18  8:19   ` Andy Shevchenko
2023-01-31  7:20     ` Sahin, Okan
2023-01-31  9:27       ` Sahin, Okan [this message]
2023-01-31 12:26         ` Andy Shevchenko
2023-01-31 13:23           ` Sahin, Okan
2023-01-31 13:29             ` Andy Shevchenko
2023-01-31 13:59               ` Sahin, Okan
2023-01-31 14:13                 ` Andy Shevchenko
2023-01-31 14:38                   ` Sahin, Okan
2023-01-31 13:32             ` Mark Brown
2023-01-31 12:24       ` Andy Shevchenko
2023-01-31 13:12         ` Sahin, Okan
2023-01-31 13:26           ` Andy Shevchenko
2023-01-18  6:38 ` [PATCH v3 4/5] dt-bindings: regulator: Add ADI MAX77541/MAX77540 Regulator Okan Sahin
2023-01-18  8:33   ` Krzysztof Kozlowski
2023-01-18  6:38 ` [PATCH v3 5/5] drivers: iio: adc: Add ADI MAX77541 ADC Support Okan Sahin
2023-01-18  8:23   ` Andy Shevchenko
2023-01-21 17:55   ` Jonathan Cameron

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=MN2PR03MB516865804044A798AEB5B6C0E7D09@MN2PR03MB5168.namprd03.prod.outlook.com \
    --to=okan.sahin@analog.com \
    --cc=Ramona.Bolboaca@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=cy_huang@richtek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=william.gray@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.