hwmon: (ntc_thermistor) Move and refactor DT parsing
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 6 Dec 2021 02:04:21 +0000 (03:04 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 26 Dec 2021 23:02:06 +0000 (15:02 -0800)
commite0149eebe47b9fe50cf85f23bcaeed81d7356c99
tree866c527fe52f3ad6737ae2a476c76073cec5f155
parentd75553790b9f44f9a6023a51ca5283ef4688f339
hwmon: (ntc_thermistor) Move and refactor DT parsing

Move the parsing of the DT config right above probe().

Allocate the state container for the driver in probe()
instead of inside the DT config parsing function: as a
result return an int instead of a pointer.

Drop the check for !np: we can only probe from DT right
now so no risk of ending up here.

Cc: Peter Rosin <peda@axentia.se>
Cc: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20211206020423.62402-1-linus.walleij@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ntc_thermistor.c