[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250210-fresh-spiked-finch-d7357e@krzk-bin>
Date: Mon, 10 Feb 2025 09:40:34 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: "Celine Joy A. Capua" <celinejoy.capua@...log.com>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 1/2] regulator: ltc7871: Add driver for LTC7871
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, <c7871_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
Powered by blists - more mailing lists