diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-15 07:40:47 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-07-18 20:05:21 -0400 |
commit | 6e729b416b44296f5ed503b40ac58c2bffb43caf (patch) | |
tree | 62389c3aca9efc519b47fdcdff4a5131feb1ac6d /drivers/video/sh_mobile_meram.c | |
parent | 4a2371772146b30113c9c837eb32b64f18376c0d (diff) |
sh_mobile_meram: Use direct function calls for the public API
There's no reason to use abstract operation pointers to implement the
MERAM API. Replace them by direct function calls.
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.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c index 4aa3fcb87f1..fdb6fc1decb 100644 --- a/drivers/video/sh_mobile_meram.c +++ b/drivers/video/sh_mobile_meram.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <linux/export.h> | ||
14 | #include <linux/genalloc.h> | 15 | #include <linux/genalloc.h> |
15 | #include <linux/io.h> | 16 | #include <linux/io.h> |
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -429,11 +430,10 @@ error: | |||
429 | return ERR_PTR(-ENOMEM); | 430 | return ERR_PTR(-ENOMEM); |
430 | } | 431 | } |
431 | 432 | ||
432 | static void *sh_mobile_cache_alloc(struct sh_mobile_meram_info *pdata, | 433 | void *sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *pdata, |
433 | const struct sh_mobile_meram_cfg *cfg, | 434 | const struct sh_mobile_meram_cfg *cfg, |
434 | unsigned int xres, unsigned int yres, | 435 | unsigned int xres, unsigned int yres, |
435 | unsigned int pixelformat, | 436 | unsigned int pixelformat, unsigned int *pitch) |
436 | unsigned int *pitch) | ||
437 | { | 437 | { |
438 | struct sh_mobile_meram_fb_cache *cache; | 438 | struct sh_mobile_meram_fb_cache *cache; |
439 | struct sh_mobile_meram_priv *priv = pdata->priv; | 439 | struct sh_mobile_meram_priv *priv = pdata->priv; |
@@ -441,6 +441,9 @@ static void *sh_mobile_cache_alloc(struct sh_mobile_meram_info *pdata, | |||
441 | unsigned int nplanes = is_nvcolor(pixelformat) ? 2 : 1; | 441 | unsigned int nplanes = is_nvcolor(pixelformat) ? 2 : 1; |
442 | unsigned int out_pitch; | 442 | unsigned int out_pitch; |
443 | 443 | ||
444 | if (priv == NULL) | ||
445 | return ERR_PTR(-ENODEV); | ||
446 | |||
444 | if (pixelformat != SH_MOBILE_MERAM_PF_NV && | 447 | if (pixelformat != SH_MOBILE_MERAM_PF_NV && |
445 | pixelformat != SH_MOBILE_MERAM_PF_NV24 && | 448 | pixelformat != SH_MOBILE_MERAM_PF_NV24 && |
446 | pixelformat != SH_MOBILE_MERAM_PF_RGB) | 449 | pixelformat != SH_MOBILE_MERAM_PF_RGB) |
@@ -485,9 +488,10 @@ err: | |||
485 | mutex_unlock(&priv->lock); | 488 | mutex_unlock(&priv->lock); |
486 | return cache; | 489 | return cache; |
487 | } | 490 | } |
491 | EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_alloc); | ||
488 | 492 | ||
489 | static void | 493 | void |
490 | sh_mobile_cache_free(struct sh_mobile_meram_info *pdata, void *data) | 494 | sh_mobile_meram_cache_free(struct sh_mobile_meram_info *pdata, void *data) |
491 | { | 495 | { |
492 | struct sh_mobile_meram_fb_cache *cache = data; | 496 | struct sh_mobile_meram_fb_cache *cache = data; |
493 | struct sh_mobile_meram_priv *priv = pdata->priv; | 497 | struct sh_mobile_meram_priv *priv = pdata->priv; |
@@ -507,11 +511,14 @@ sh_mobile_cache_free(struct sh_mobile_meram_info *pdata, void *data) | |||
507 | 511 | ||
508 | mutex_unlock(&priv->lock); | 512 | mutex_unlock(&priv->lock); |
509 | } | 513 | } |
510 | 514 | EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_free); | |
511 | static void | 515 | |
512 | sh_mobile_cache_update(struct sh_mobile_meram_info *pdata, void *data, | 516 | void |
513 | unsigned long base_addr_y, unsigned long base_addr_c, | 517 | sh_mobile_meram_cache_update(struct sh_mobile_meram_info *pdata, void *data, |
514 | unsigned long *icb_addr_y, unsigned long *icb_addr_c) | 518 | unsigned long base_addr_y, |
519 | unsigned long base_addr_c, | ||
520 | unsigned long *icb_addr_y, | ||
521 | unsigned long *icb_addr_c) | ||
515 | { | 522 | { |
516 | struct sh_mobile_meram_fb_cache *cache = data; | 523 | struct sh_mobile_meram_fb_cache *cache = data; |
517 | struct sh_mobile_meram_priv *priv = pdata->priv; | 524 | struct sh_mobile_meram_priv *priv = pdata->priv; |
@@ -523,13 +530,7 @@ sh_mobile_cache_update(struct sh_mobile_meram_info *pdata, void *data, | |||
523 | 530 | ||
524 | mutex_unlock(&priv->lock); | 531 | mutex_unlock(&priv->lock); |
525 | } | 532 | } |
526 | 533 | EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_update); | |
527 | static struct sh_mobile_meram_ops sh_mobile_meram_ops = { | ||
528 | .module = THIS_MODULE, | ||
529 | .cache_alloc = sh_mobile_cache_alloc, | ||
530 | .cache_free = sh_mobile_cache_free, | ||
531 | .cache_update = sh_mobile_cache_update, | ||
532 | }; | ||
533 | 534 | ||
534 | /* ----------------------------------------------------------------------------- | 535 | /* ----------------------------------------------------------------------------- |
535 | * Power management | 536 | * Power management |
@@ -620,7 +621,6 @@ static int __devinit sh_mobile_meram_probe(struct platform_device *pdev) | |||
620 | for (i = 0; i < MERAM_ICB_NUM; ++i) | 621 | for (i = 0; i < MERAM_ICB_NUM; ++i) |
621 | priv->icbs[i].index = i; | 622 | priv->icbs[i].index = i; |
622 | 623 | ||
623 | pdata->ops = &sh_mobile_meram_ops; | ||
624 | pdata->priv = priv; | 624 | pdata->priv = priv; |
625 | pdata->pdev = pdev; | 625 | pdata->pdev = pdev; |
626 | 626 | ||