Commit 82f1faa8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-v4.11-rc6' of git://github.com/bzolnier/linux

Pull fbdev fixes from Bartlomiej Zolnierkiewicz:

 - fix probing time checks in omapfb driver (regression fix)

 - fix optional VBAT support in ssd1307fb driver (regression fix)

 - fix connecting to backend in xen-fbfront driver

* tag 'fbdev-v4.11-rc6' of git://github.com/bzolnier/linux:
  fbdev: omapfb: delete check_required_callbacks()
  xen, fbfront: fix connecting to backend
  fbdev/ssd1307fb: fix optional VBAT support
parents e16d8b6e e68d490d
...@@ -1608,19 +1608,6 @@ static int omapfb_find_ctrl(struct omapfb_device *fbdev) ...@@ -1608,19 +1608,6 @@ static int omapfb_find_ctrl(struct omapfb_device *fbdev)
return 0; return 0;
} }
static void check_required_callbacks(struct omapfb_device *fbdev)
{
#define _C(x) (fbdev->ctrl->x != NULL)
#define _P(x) (fbdev->panel->x != NULL)
BUG_ON(fbdev->ctrl == NULL || fbdev->panel == NULL);
BUG_ON(!(_C(init) && _C(cleanup) && _C(get_caps) &&
_C(set_update_mode) && _C(setup_plane) && _C(enable_plane) &&
_P(init) && _P(cleanup) && _P(enable) && _P(disable) &&
_P(get_caps)));
#undef _P
#undef _C
}
/* /*
* Called by LDM binding to probe and attach a new device. * Called by LDM binding to probe and attach a new device.
* Initialization sequence: * Initialization sequence:
...@@ -1705,8 +1692,6 @@ static int omapfb_do_probe(struct platform_device *pdev, ...@@ -1705,8 +1692,6 @@ static int omapfb_do_probe(struct platform_device *pdev,
omapfb_ops.fb_mmap = omapfb_mmap; omapfb_ops.fb_mmap = omapfb_mmap;
init_state++; init_state++;
check_required_callbacks(fbdev);
r = planes_init(fbdev); r = planes_init(fbdev);
if (r) if (r)
goto cleanup; goto cleanup;
......
...@@ -578,11 +578,15 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -578,11 +578,15 @@ static int ssd1307fb_probe(struct i2c_client *client,
par->vbat_reg = devm_regulator_get_optional(&client->dev, "vbat"); par->vbat_reg = devm_regulator_get_optional(&client->dev, "vbat");
if (IS_ERR(par->vbat_reg)) { if (IS_ERR(par->vbat_reg)) {
dev_err(&client->dev, "failed to get VBAT regulator: %ld\n",
PTR_ERR(par->vbat_reg));
ret = PTR_ERR(par->vbat_reg); ret = PTR_ERR(par->vbat_reg);
if (ret == -ENODEV) {
par->vbat_reg = NULL;
} else {
dev_err(&client->dev, "failed to get VBAT regulator: %d\n",
ret);
goto fb_alloc_error; goto fb_alloc_error;
} }
}
if (of_property_read_u32(node, "solomon,width", &par->width)) if (of_property_read_u32(node, "solomon,width", &par->width))
par->width = 96; par->width = 96;
...@@ -668,11 +672,14 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -668,11 +672,14 @@ static int ssd1307fb_probe(struct i2c_client *client,
udelay(4); udelay(4);
} }
if (par->vbat_reg) {
ret = regulator_enable(par->vbat_reg); ret = regulator_enable(par->vbat_reg);
if (ret) { if (ret) {
dev_err(&client->dev, "failed to enable VBAT: %d\n", ret); dev_err(&client->dev, "failed to enable VBAT: %d\n",
ret);
goto reset_oled_error; goto reset_oled_error;
} }
}
ret = ssd1307fb_init(par); ret = ssd1307fb_init(par);
if (ret) if (ret)
...@@ -710,6 +717,7 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -710,6 +717,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
pwm_put(par->pwm); pwm_put(par->pwm);
}; };
regulator_enable_error: regulator_enable_error:
if (par->vbat_reg)
regulator_disable(par->vbat_reg); regulator_disable(par->vbat_reg);
reset_oled_error: reset_oled_error:
fb_deferred_io_cleanup(info); fb_deferred_io_cleanup(info);
......
...@@ -643,7 +643,6 @@ static void xenfb_backend_changed(struct xenbus_device *dev, ...@@ -643,7 +643,6 @@ static void xenfb_backend_changed(struct xenbus_device *dev,
break; break;
case XenbusStateInitWait: case XenbusStateInitWait:
InitWait:
xenbus_switch_state(dev, XenbusStateConnected); xenbus_switch_state(dev, XenbusStateConnected);
break; break;
...@@ -654,7 +653,8 @@ static void xenfb_backend_changed(struct xenbus_device *dev, ...@@ -654,7 +653,8 @@ static void xenfb_backend_changed(struct xenbus_device *dev,
* get Connected twice here. * get Connected twice here.
*/ */
if (dev->state != XenbusStateConnected) if (dev->state != XenbusStateConnected)
goto InitWait; /* no InitWait seen yet, fudge it */ /* no InitWait seen yet, fudge it */
xenbus_switch_state(dev, XenbusStateConnected);
if (xenbus_read_unsigned(info->xbdev->otherend, if (xenbus_read_unsigned(info->xbdev->otherend,
"request-update", 0)) "request-update", 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment