summaryrefslogtreecommitdiff
path: root/drivers/video/sh_mobile_meram.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-11-22 00:56:58 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-12 22:41:14 +0100
commitcdf88b9072a86545611b9c3f5597ebc47e50ffc1 (patch)
treec3a31efccd11d573334663557171a22dd525eea1 /drivers/video/sh_mobile_meram.c
parent97d16fe69b6499a14a0c85c053f7bef54ce992a4 (diff)
downloadlwn-cdf88b9072a86545611b9c3f5597ebc47e50ffc1.tar.gz
lwn-cdf88b9072a86545611b9c3f5597ebc47e50ffc1.zip
fbdev: sh_mobile_meram: Remove unneeded sanity checks
The meram_register(), meram_unregister() and meram_update() operations check that the pointers they get from the caller are not NULL. Those checks can be remove, as the caller already ensures that the pointers are valid. The platform sanity checks can also be removed, as the operations can't be accessed without valid platform data anyway. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/video/sh_mobile_meram.c')
-rw-r--r--drivers/video/sh_mobile_meram.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
index 2ce0d8f72e31..d9f7a44c231c 100644
--- a/drivers/video/sh_mobile_meram.c
+++ b/drivers/video/sh_mobile_meram.c
@@ -451,21 +451,15 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata,
unsigned int *pitch)
{
struct sh_mobile_meram_fb_cache *cache;
- struct sh_mobile_meram_priv *priv;
- struct platform_device *pdev;
+ struct sh_mobile_meram_priv *priv = pdata->priv;
+ struct platform_device *pdev = pdata->pdev;
unsigned int out_pitch;
- if (!pdata || !pdata->priv || !pdata->pdev || !cfg)
- return ERR_PTR(-EINVAL);
-
if (pixelformat != SH_MOBILE_MERAM_PF_NV &&
pixelformat != SH_MOBILE_MERAM_PF_NV24 &&
pixelformat != SH_MOBILE_MERAM_PF_RGB)
return ERR_PTR(-EINVAL);
- priv = pdata->priv;
- pdev = pdata->pdev;
-
dev_dbg(&pdev->dev, "registering %dx%d (%s)", xres, yres,
!pixelformat ? "yuv" : "rgb");
@@ -500,16 +494,11 @@ err:
return cache;
}
-static int
+static void
sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data)
{
struct sh_mobile_meram_fb_cache *cache = data;
- struct sh_mobile_meram_priv *priv;
-
- if (!pdata || !pdata->priv || !data)
- return -EINVAL;
-
- priv = pdata->priv;
+ struct sh_mobile_meram_priv *priv = pdata->priv;
mutex_lock(&priv->lock);
@@ -521,22 +510,15 @@ sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data)
meram_free(priv, cache);
mutex_unlock(&priv->lock);
-
- return 0;
}
-static int
+static void
sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data,
unsigned long base_addr_y, unsigned long base_addr_c,
unsigned long *icb_addr_y, unsigned long *icb_addr_c)
{
struct sh_mobile_meram_fb_cache *cache = data;
- struct sh_mobile_meram_priv *priv;
-
- if (!pdata || !pdata->priv || !data)
- return -EINVAL;
-
- priv = pdata->priv;
+ struct sh_mobile_meram_priv *priv = pdata->priv;
mutex_lock(&priv->lock);
@@ -544,8 +526,6 @@ sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data,
meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c);
mutex_unlock(&priv->lock);
-
- return 0;
}
static struct sh_mobile_meram_ops sh_mobile_meram_ops = {