* [bug report] mfd: ene-kb3930: Add driver for ENE KB3930 Embedded Controller
@ 2020-09-10 8:40 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-09-10 8:40 UTC (permalink / raw)
To: kernel-janitors
Hello Lubomir Rintel,
The patch 753bd752e181: "mfd: ene-kb3930: Add driver for ENE KB3930
Embedded Controller" from Jul 10, 2020, leads to the following static
checker warning:
drivers/mfd/ene-kb3930.c:165 kb3930_probe()
warn: 'ddata->off_gpios' can also be NULL
drivers/mfd/ene-kb3930.c
152
153 ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO,
154 ariel_ec_cells,
155 ARRAY_SIZE(ariel_ec_cells),
156 NULL, 0, NULL);
157 if (ret)
158 return ret;
159
160 if (of_property_read_bool(np, "system-power-controller")) {
161 ddata->off_gpios 162 devm_gpiod_get_array_optional(dev, "off", GPIOD_IN);
The devm_gpiod_get_array_optional() function can return NULL in the
sitation where the optional array is not there. It's not an error
because it's an optional thing, but there is also no valid pointer to
return. So because it's not an error pointer, or a valid pointer then
it's NULL.
163 if (IS_ERR(ddata->off_gpios))
164 return PTR_ERR(ddata->off_gpios);
165 if (ddata->off_gpios->ndescs < 2) {
166 dev_err(dev, "invalid off-gpios property\n");
167 return -EINVAL;
168 }
169 }
170
171 if (ddata->off_gpios) {
172 register_restart_handler(&kb3930_restart_nb);
173 if (!pm_power_off)
174 pm_power_off = kb3930_pm_power_off;
175 }
176
177 return 0;
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-10 8:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 8:40 [bug report] mfd: ene-kb3930: Add driver for ENE KB3930 Embedded Controller Dan Carpenter
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.