mirror of https://github.com/torvalds/linux.git
regulator: bd96801: Constify pointers to 'regulator_desc' wrap struct
Pointer to 'struct regulator_desc' is a pointer to const and the wrapping structure (container) is not being modified, thus entire syntax can be replaced to preferred and safer container_of_const(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251126-container-of-const-regulator-v1-5-eeec378144d4@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7a7e1ed307
commit
50011cacae
|
|
@ -337,11 +337,11 @@ static int ldo_map_notif(int irq, struct regulator_irq_data *rid,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < rid->num_states; i++) {
|
for (i = 0; i < rid->num_states; i++) {
|
||||||
struct bd96801_regulator_data *rdata;
|
const struct bd96801_regulator_data *rdata;
|
||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
|
|
||||||
rdev = rid->states[i].rdev;
|
rdev = rid->states[i].rdev;
|
||||||
rdata = container_of(rdev->desc, struct bd96801_regulator_data,
|
rdata = container_of_const(rdev->desc, struct bd96801_regulator_data,
|
||||||
desc);
|
desc);
|
||||||
rid->states[i].notifs = regulator_err2notif(rdata->ldo_errs);
|
rid->states[i].notifs = regulator_err2notif(rdata->ldo_errs);
|
||||||
rid->states[i].errors = rdata->ldo_errs;
|
rid->states[i].errors = rdata->ldo_errs;
|
||||||
|
|
@ -354,9 +354,9 @@ static int bd96801_list_voltage_lr(struct regulator_dev *rdev,
|
||||||
unsigned int selector)
|
unsigned int selector)
|
||||||
{
|
{
|
||||||
int voltage;
|
int voltage;
|
||||||
struct bd96801_regulator_data *data;
|
const struct bd96801_regulator_data *data;
|
||||||
|
|
||||||
data = container_of(rdev->desc, struct bd96801_regulator_data, desc);
|
data = container_of_const(rdev->desc, struct bd96801_regulator_data, desc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The BD096801 has voltage setting in two registers. One giving the
|
* The BD096801 has voltage setting in two registers. One giving the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue