diff options
author | Alan Cox <alan@linux.intel.com> | 2011-07-05 15:38:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-05 08:20:40 -0700 |
commit | 92367fe1bca91efa7f689127ba45080d4303d609 (patch) | |
tree | e90f61df9661bf409aa371cbc94069a60bef5117 /drivers/staging/gma500/mdfld_output.c | |
parent | bcc70a64a443ec19f84bb0dc3268d2c95b52e209 (diff) |
gma500: being abstracting out devices a bit more
We really want to move towards a completely abstracted interface rather
than having tons of per chip junk in the same files.
Begin with the power code which is probably the worst offender. Add a set
of methods, initialise a dev_priv->ops pointer and rip the chip specifics
out of the power code. While we are it pick up the display init bits.
So we know it's now chip specifics clean remove the psb_ naming from it.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/gma500/mdfld_output.c')
-rw-r--r-- | drivers/staging/gma500/mdfld_output.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/staging/gma500/mdfld_output.c b/drivers/staging/gma500/mdfld_output.c index b1fc7656b2de..7e11401d67bb 100644 --- a/drivers/staging/gma500/mdfld_output.c +++ b/drivers/staging/gma500/mdfld_output.c @@ -63,14 +63,20 @@ int mdfld_panel_dpi(struct drm_device *dev) } } -static void init_panel(struct drm_device *dev, int mipi_pipe, int p_type) +static int init_panel(struct drm_device *dev, int mipi_pipe, int p_type) { struct panel_funcs *p_cmd_funcs; struct panel_funcs *p_vid_funcs; /* Oh boy ... FIXME */ p_cmd_funcs = kzalloc(sizeof(struct panel_funcs), GFP_KERNEL); + if (p_cmd_funcs == NULL) + return -ENODEV; p_vid_funcs = kzalloc(sizeof(struct panel_funcs), GFP_KERNEL); + if (p_vid_funcs == NULL) { + kfree(p_cmd_funcs); + return -ENODEV; + } switch (p_type) { case TPO_CMD: @@ -115,11 +121,12 @@ static void init_panel(struct drm_device *dev, int mipi_pipe, int p_type) #endif default: dev_err(dev->dev, "Unsupported interface %d", p_type); - break; + return -ENODEV; } + return 0; } -void mdfld_output_init(struct drm_device *dev) +int mdfld_output_init(struct drm_device *dev) { int type; @@ -132,4 +139,6 @@ void mdfld_output_init(struct drm_device *dev) type = mdfld_get_panel_type(dev, 2); dev_info(dev->dev, "panel 2: type is %d\n", type); init_panel(dev, 2, type); + + return 0; } |