Re: [PATCH 1/2] regulator: ltc7871: Add driver for LTC7871

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 10, 2025 at 10:30:52AM +0800, Celine Joy A. Capua wrote:
> +	chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
> +	if (!chip)
> +		return -ENOMEM;
> +
> +	crc8_populate_msb(ltc7871_crc8_table, LTC7871_CRC8_POLY);
> +
> +	chip->spi = spi;
> +
> +	ret = ltc7871_parse_fw(chip);
> +	if (ret < 0)
> +		return ret;
> +
> +	config.dev = dev;
> +	config.init_data = init_data;
> +	config.driver_data = chip;
> +
> +	chip->rdev = devm_regulator_register(dev, &ltc7871_regulator_desc,
> +					     &config);
> +
> +	return PTR_ERR_OR_ZERO(chip->rdev);
> +}
> +
> +static const struct of_device_id ltc7871_of_match[] = {
> +	{ .compatible = "adi,ltc7871", },
> +	{ .compatible = "adi,ltc7872", },


This means devices are compatible?

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, ltc7871_of_match);
> +
> +static const struct spi_device_id ltc7871_id[] = {
> +	{"ltc7871" },
> +	{"ltc7872" },
> +	{ },

Keep your code consistent. In OF table you have comma after each
compatible, but not here. Space before field, but not here. No trailing
comma on last entry, but it is here. I don't care about the actual
style, just write something consistent, not random.

Best regards,
Krzysztof





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux