diff mbox

[v16,RESEND,0/7] of: add display helper

Message ID C8443D0743D26F4388EA172BF4E2A7A93EA928F9@DBDE01.ent.ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Afzal Mohammed Jan. 24, 2013, 8:47 a.m. UTC
Hi Steffen,

On Thu, Jan 24, 2013 at 13:49:58, Steffen Trumtrar wrote:

> Thanks. I'll use that opportunity for a v17 that is rebased onto 3.8-rc4.

As you are going to have a v17, if you can fold the diff[1]
(that I mentioned earlier) into the patch,
"fbmon: add of_videomode helpers", it would be helpful. 

Regards
Afzal

[1]

Comments

Steffen Trumtrar Jan. 25, 2013, 8:04 a.m. UTC | #1
Hi Afzal,

On Thu, Jan 24, 2013 at 08:47:02AM +0000, Mohammed, Afzal wrote:
> Hi Steffen,
> 
> On Thu, Jan 24, 2013 at 13:49:58, Steffen Trumtrar wrote:
> 
> > Thanks. I'll use that opportunity for a v17 that is rebased onto 3.8-rc4.
> 
> As you are going to have a v17, if you can fold the diff[1]
> (that I mentioned earlier) into the patch,
> "fbmon: add of_videomode helpers", it would be helpful. 
> 

I thought about it and I will not include that patch. Sorry.
In one of the previous versions of the series I had something like that and
it was suggested to remove it. If I leave it like it is, one gets a compile
time error like you do. And that is correct, because you shouldn't use the
function if you do not have of_videomode enabled. You should use one of the
underlying functions that are non-DT and called by of_get_fb_videomode.

Regards,
Steffen

> Regards
> Afzal
> 
> [1]
> 
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 58b9860..0ce30d1 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -716,9 +716,19 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb);
>  extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
>  extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
>  
> +#if defined(CONFIG_OF_VIDEOMODE) && defined(CONFIG_FB_MODE_HELPERS)
>  extern int of_get_fb_videomode(struct device_node *np,
>                                struct fb_videomode *fb,
>                                int index);
> +#else
> +static inline int of_get_fb_videomode(struct device_node *np,
> +                                     struct fb_videomode *fb,
> +                                     int index)
> +{
> +       return -EINVAL;
> +}
> +#endif
> +
>  extern int fb_videomode_from_videomode(const struct videomode *vm,
>                                        struct fb_videomode *fbmode);
>
diff mbox

Patch

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 58b9860..0ce30d1 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -716,9 +716,19 @@  extern void fb_destroy_modedb(struct fb_videomode *modedb);
 extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
 extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
 
+#if defined(CONFIG_OF_VIDEOMODE) && defined(CONFIG_FB_MODE_HELPERS)
 extern int of_get_fb_videomode(struct device_node *np,
                               struct fb_videomode *fb,
                               int index);
+#else
+static inline int of_get_fb_videomode(struct device_node *np,
+                                     struct fb_videomode *fb,
+                                     int index)
+{
+       return -EINVAL;
+}
+#endif
+
 extern int fb_videomode_from_videomode(const struct videomode *vm,
                                       struct fb_videomode *fbmode);