Re: [PATCH v2 1/3] backlight: lp855x: Move device_config setting out of lp855x_configure()

2021-12-22 Thread Lee Jones
On Tue, 02 Nov 2021, Hans de Goede wrote:

> Move the setting of the lp->cfg pointer to the chip specific
> lp855x_device_config struct from lp855x_configure() to
> lp855x_probe(), before calling lp855x_parse_dt().
> 
> This is a preperation patch for adding ACPI enumeration support.
> 
> Reviewed-by: Daniel Thompson 
> Signed-off-by: Hans de Goede 

Please keep sign-offs in chronological order.

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog


[PATCH v2 1/3] backlight: lp855x: Move device_config setting out of lp855x_configure()

2021-11-02 Thread Hans de Goede
Move the setting of the lp->cfg pointer to the chip specific
lp855x_device_config struct from lp855x_configure() to
lp855x_probe(), before calling lp855x_parse_dt().

This is a preperation patch for adding ACPI enumeration support.

Reviewed-by: Daniel Thompson 
Signed-off-by: Hans de Goede 
---
 drivers/video/backlight/lp855x_bl.c | 32 ++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/video/backlight/lp855x_bl.c 
b/drivers/video/backlight/lp855x_bl.c
index e94932c69f54..808ff00b2003 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -170,22 +170,6 @@ static int lp855x_configure(struct lp855x *lp)
int i, ret;
struct lp855x_platform_data *pd = lp->pdata;
 
-   switch (lp->chip_id) {
-   case LP8550:
-   case LP8551:
-   case LP8552:
-   case LP8553:
-   case LP8556:
-   lp->cfg = _dev_cfg;
-   break;
-   case LP8555:
-   case LP8557:
-   lp->cfg = _dev_cfg;
-   break;
-   default:
-   return -EINVAL;
-   }
-
if (lp->cfg->pre_init_device) {
ret = lp->cfg->pre_init_device(lp);
if (ret) {
@@ -413,6 +397,22 @@ static int lp855x_probe(struct i2c_client *cl, const 
struct i2c_device_id *id)
lp->chip_id = id->driver_data;
lp->pdata = dev_get_platdata(>dev);
 
+   switch (lp->chip_id) {
+   case LP8550:
+   case LP8551:
+   case LP8552:
+   case LP8553:
+   case LP8556:
+   lp->cfg = _dev_cfg;
+   break;
+   case LP8555:
+   case LP8557:
+   lp->cfg = _dev_cfg;
+   break;
+   default:
+   return -EINVAL;
+   }
+
if (!lp->pdata) {
ret = lp855x_parse_dt(lp);
if (ret < 0)
-- 
2.31.1