Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH] Staging: sm750fb: fix checkpatch.pl indentation warnings
From: Dighe, Niranjan (N.) @ 2015-06-15  3:34 UTC (permalink / raw)
  To: Markus Böhme
  Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
	gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
In-Reply-To: <557DCBAE.8070109@mailbox.org>

On Sun, Jun 14, 2015 at 08:45:02PM +0200, Markus Böhme wrote:
> >This patch fixes indentation issues by replacing spaces by tabs at
> >the start of line
> >
> >Signed-off-by: Niranjan Dighe <ndighe@visteon.com>
> >
> >diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
> >index b2bf7e6..c73b74a 100644
> >--- a/drivers/staging/sm750fb/ddk750_dvi.c
> >+++ b/drivers/staging/sm750fb/ddk750_dvi.c
> 
> >-	if(pCurrentDviCtrl->pfnInit != NULL)
> >+	if (pCurrentDviCtrl->pfnInit != NULL)
> 
> You are fixing a different type of warning here. Please make only one
> kind of change per patch.
> 
> Regards,
> Markus
> 

Hello Markus,

Thanks for your review. I will correct and resend a new patch. Please disregard
this for the moment.

Thanks,
Niranjan Dighe

^ permalink raw reply

* Klientskie bazi tel +79133913837 Email: nonen22pp@gmail.com Yznaite podrobnee!!!
From:  @ 2015-06-15  5:02 UTC (permalink / raw)
  To: linux-fbdev

Klientskie bazi tel +79133913837 Email: nonen22pp@gmail.com Yznaite podrobnee!!!

^ permalink raw reply

* Re: doubt about sm7xxfb (was: Re: [PATCH v4 0/7] staging: fsl-mc: New functionality to the MC bus dr
From: Sudip Mukherjee @ 2015-06-15  5:29 UTC (permalink / raw)
  To: Joe Perches
  Cc: Greg KH, devel, linux-fbdev, tomi.valkeinen, linux-kernel,
	dan.carpenter
In-Reply-To: <1434214625.2507.9.camel@perches.com>

On Sat, Jun 13, 2015 at 09:57:05AM -0700, Joe Perches wrote:
> 
> It seems ready to me.
> 
> As far as I can tell, there's just a few niggles
> that could be done:
> 
> Something like (too lazy to separate them into multiple patches)
Thanks.	I will break into patches. Call me lazy for not having it done
till now.
> 
> o reduce indentation a couple of places
> o add newlines to logging messages
> o add const to static array
> o use consistent function declaration style
> 
> It's unfortunate there are so many #ifdef __BIG_ENDIAN uses.
instead of #ifdef __BIG_ENDIAN can i then use a bool flag to check by if-else?

regards
sudip

^ permalink raw reply

* Re: [PATCH] Staging: sm750fb: Fix checkpatch.pl warnings
From: Sudip Mukherjee @ 2015-06-15  5:39 UTC (permalink / raw)
  To: Dighe, Niranjan (N.)
  Cc: teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org,
	linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <20150614171728.GA5800@codebox>

On Sun, Jun 14, 2015 at 05:17:43PM +0000, Dighe, Niranjan (N.) wrote:
> From: Niranjan Dighe <ndighe@visteon.com>
> 
> This patch removes spaces at the start of the line and replaces it
> by tabs
You are also removing blank lines, adding blank lines, moving a ')' to
next line.

regards
sudip

^ permalink raw reply

* Re: [Xen-devel] RIP MTRR - status update for upcoming v4.2
From: Jan Beulich @ 2015-06-15  6:20 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Luis R. Rodriguez, Bjorn Helgaas, Jej B, Toshi Kani, X86 ML,
	Andrew Morton, ville.syrjala, Julia Lawall,
	xen-devel@lists.xenproject.org, Dave Airlie, syrjala,
	Juergen Gross, Luis Rodriguez, Borislav Petkov, Tomi Valkeinen,
	linux-fbdev, linux-kernel@vger.kernel.org, linux-media,
	linux-pci@vger.kernel.org
In-Reply-To: <CALCETrXWZU2NZRZy7b74z54Tt5aKmTOmgMmf5WYG1OZtEmjw7A@mail.gmail.com>

>>> On 13.06.15 at 01:15, <luto@amacapital.net> wrote:
> On Jun 12, 2015 12:59 AM, "Jan Beulich" <JBeulich@suse.com> wrote:
>>
>> >>> On 12.06.15 at 01:23, <toshi.kani@hp.com> wrote:
>> > There are two usages on MTRRs:
>> >  1) MTRR entries set by firmware
>> >  2) MTRR entries set by OS drivers
>> >
>> > We can obsolete 2), but we have no control over 1).  As UEFI firmwares
>> > also set this up, this usage will continue to stay.  So, we should not
>> > get rid of the MTRR code that looks up the MTRR entries, while we have
>> > no need to modify them.
>> >
>> > Such MTRR entries provide safe guard to /dev/mem, which allows
>> > privileged user to access a range that may require UC mapping while
>> > the /dev/mem driver blindly maps it with WB.  MTRRs converts WB to UC in
>> > such a case.
>>
>> But it wouldn't be impossible to simply read the MTRRs upon boot,
>> store the information, disable MTRRs, and correctly use PAT to
>> achieve the same effect (i.e. the "blindly maps" part of course
>> would need fixing).
> 
> This may crash and burn badly when we call a UEFI function or an SMI
> happens.  I think we should just leave the MTRRs alone.

I buy the SMI part, but UEFI runtime calls are being done on
page tables we construct and control, so attributes could be kept
correct without relying on MTRRs.

Jan


^ permalink raw reply

* Re: doubt about sm7xxfb (was: Re: [PATCH v4 0/7] staging: fsl-mc: New functionality to the MC bus dr
From: Joe Perches @ 2015-06-15  6:36 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Greg KH, devel, linux-fbdev, tomi.valkeinen, linux-kernel,
	dan.carpenter
In-Reply-To: <20150615051712.GA21087@sudip-PC>

On Mon, 2015-06-15 at 10:47 +0530, Sudip Mukherjee wrote:
> On Sat, Jun 13, 2015 at 09:57:05AM -0700, Joe Perches wrote:
> > It's unfortunate there are so many #ifdef __BIG_ENDIAN uses.
> instead of #ifdef __BIG_ENDIAN can i then use a bool flag to check by if-else?

I think that'd be worse.  Moving the #ifdef into the .h
may be better, but <shrug>, whatever works well enough.

Another thing may be to move the vgamode array declaration
in fb7xx.h to the .c file and make it const and remove the
#define numvgamodes and just use ARRAY_SIZE directly in
the one place it's used.


^ permalink raw reply

* Re: [PATCH 00/21] On-demand device registration
From: Linus Walleij @ 2015-06-15  8:58 UTC (permalink / raw)
  To: Alexander Holler
  Cc: Tomeu Vizoso, Grant Likely, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-samsung-soc,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dmitry Torokhov,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	DRM PANEL DRIVERS, dmaengine-u79uwXL29TY76Z2rM5mHXA, Dan Williams,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <557C7609.30400-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>

On Sat, Jun 13, 2015 at 8:27 PM, Alexander Holler <holler@ahsoftware.de> wrote:

> And because you've said that "problem space is a bit convoluted" and I
> disagree, here's a summary from my point of view:
>
> 1. All the necessary information (dependencies between drivers) already
> exists at compile time. The set of dependencies between drivers might become
> smaller by configuration, but will not become larger. So there should be NO
> need to collect them at runtime, e.g. by instrumenting function calls.

I think you arrived at the core of the crux here.

When we look up a resource provided from another driver, e.g. from
regulator_get(), clk_get(), pinctrl_get(), gpiod_get() etc - the dependency
is resolved by looking in a cross-reference table for either a struct device*
pointer or a string, an index, or both or all three. Examples:

struct regulator *regulator_get(struct device *dev, const char *id);
struct clk *clk_get(struct device *dev, const char *id);
struct gpio_desc *__must_check __gpiod_get(struct device *dev,
                                         const char *con_id,
                                         enum gpiod_flags flags);
(...)

(*_index() variants exist on some of the resource retrieveal
functions.)

struct device * is the device requesting the resource, con_id
is the string name of the resource on the provider side. This is all
solved by looking in cross reference tables. ONE way of resolving
that cross reference is to look into the device tree or the ACPI table.
But for the board file case, this is resolved at runtime by the cross
reference table, registered with calls such as gpiod_add_lookup_table().

It is true that in the theoretical sense, all of this exist at compile time
especially if you can parse something like a device tree and
figure out what struct device * nodes will correspond to the struct
device_node:s in it. For ACPI I guess a similar procedure is viable.

Problem: this requires the kernel compile to know exactly *which* device tree
or ACPI table it is going to boot on. The expressed goal of device tree
and ACPI is to have *ONE* kernel booting several device trees.
Here your approach stops short: you are suggesting instrumenting
the kernel at compile time to one single device tree or ACPI table.
But we never know really what device tree or ACPI table will be used.
This just cannot be done at compile time for that reason alone.

Example: in boot case (A) the regulator may be provided by regulator
"foo" driver on an i2c bus. But in boot case (B) the very same regulator
may be provided by regulator "bar" on an SPI bus. These are very
real usecases, for example for drivers/net/ethernet/smsc/smsc911x.c,
will get regulators from the most diverse places depending on what
device tree is used.

For board files, it is neither possible in theory: you need to compile the
code to figure out the struct device * provider, and/or the string name
of the providing device (.name field in struct device for the provider)
to resolve dependencies at compile time.

For the board file case, resolving dependencies at compile time will
require a quite complex two-stage rocket: compile the code to
get resources out, then recompile with known resources.

I guess your suggested approach then need to introduce a special
build tool to order the initcalls accordingly.

Again this will fall short if you don't know at compile time exactly
*which* board file will be executed.

So the only practical way to solve this at compile time is to predict
an initcall ordering sequence for all possible boot paths, compile in
all of them, and choose the right one at boot. But the number of boot
paths is equal to the number of device trees / ACPI tables or
board files supported, and that space is uncontrolled and ordered
infinite.

Basically I think the root problem with your approach is that you
assume we know what hardware we will boot on at compile time. We
discarded that development path years ago. We have no clue, this
is resolved at runtime. Alas, people still create super-optimized
systems using exactly this knowledge, but it is not our main target
here, it is a special optimization case.

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH 00/21] On-demand device registration
From: Alexander Holler @ 2015-06-15  9:42 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tomeu Vizoso, Grant Likely, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-samsung-soc,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dmitry Torokhov,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	DRM PANEL DRIVERS, dmaengine-u79uwXL29TY76Z2rM5mHXA, Dan Williams,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CACRpkdaVZmq_w_qgEgTP5oqfH3K1+80O7z7o7CJx-dhivUGhDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Am 15.06.2015 um 10:58 schrieb Linus Walleij:
> On Sat, Jun 13, 2015 at 8:27 PM, Alexander Holler <holler@ahsoftware.de> wrote:
>
>> And because you've said that "problem space is a bit convoluted" and I
>> disagree, here's a summary from my point of view:
>>
>> 1. All the necessary information (dependencies between drivers) already
>> exists at compile time. The set of dependencies between drivers might become
>> smaller by configuration, but will not become larger. So there should be NO
>> need to collect them at runtime, e.g. by instrumenting function calls.
>
> I think you arrived at the core of the crux here.

I've hoped so, that's why I've written it.

> I guess your suggested approach then need to introduce a special
> build tool to order the initcalls accordingly.
>
> Again this will fall short if you don't know at compile time exactly
> *which* board file will be executed.

I've just tried to describe the facts in order to make the problem space 
more clear, because, as said, I don't think it's convoluted.

Besides that, I didn't want to suggest anything else other than what 
I've already posted working patches for. What I've mentioned as possible 
other solutions above is stuff which might be possible too in order to 
give some starting points for people which are searching another 
solution. But I wouldn't have written my patches as they are, if I would 
think there is another more easier solution.

And of course, there is still a bit to resolve at runtime, even in the 
DT case (look at the "compatible" attribute). But there is already a 
runtime solution to find the right driver (in case of DT) and I haven't 
mentioned it in order to no confuse people again. Mentioning every 
little detail doesn't make sense if you want to describe something 
understandable (which is what I've tried).

> So the only practical way to solve this at compile time is to predict
> an initcall ordering sequence for all possible boot paths, compile in
> all of them, and choose the right one at boot. But the number of boot
> paths is equal to the number of device trees / ACPI tables or
> board files supported, and that space is uncontrolled and ordered
> infinite.

You just need one working ordered sequence which includes all options. 
This one will work for all others too.

> Basically I think the root problem with your approach is that you
> assume we know what hardware we will boot on at compile time. We

Totally wrong. If you assume that I assume this, than either I was 
totally unable to describe something clearly, or you were unable or 
unwilling to understand what I've written. And as the result is the 
same, we don't need to find out which was reason.

Anyway, have fun. I'm quitting the discussion here as I don't have any 
business with the kernel and already decided some time again to not post 
patches anymore as it seems to be a waste of my (and maybe others) time.

Regards,

Alexander Holler

^ permalink raw reply

* Re: [PATCH] Staging: sm750fb: Fix checkpatch.pl warnings
From: Dighe, Niranjan (N.) @ 2015-06-15 10:23 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org,
	linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <20150615052733.GB21087@sudip-PC>

On Mon, Jun 15, 2015 at 10:57:33AM +0530, Sudip Mukherjee wrote:
> On Sun, Jun 14, 2015 at 05:17:43PM +0000, Dighe, Niranjan (N.) wrote:
> > From: Niranjan Dighe <ndighe@visteon.com>
> > 
> > This patch removes spaces at the start of the line and replaces it
> > by tabs
> You are also removing blank lines, adding blank lines, moving a ')' to
> next line.
> 
> regards
> sudip

Alright. I will modify the patch and resend.

Thanks,
Niranjan 

^ permalink raw reply

* Re: [PATCH v4 3/3] video: fbdev: vesafb: use arch_phys_wc_add()
From: Luis R. Rodriguez @ 2015-06-15 22:27 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Luis R. Rodriguez, plagnioj, bp, hpa, linux-fbdev, luto,
	toshi.kani, sbsiddha, mingo, tglx, jgross, daniel.vetter, airlied,
	adaplas, robdclark, jg1.han, wsa, linux-kernel
In-Reply-To: <557AA08E.6050606@ti.com>

On Fri, Jun 12, 2015 at 12:04:14PM +0300, Tomi Valkeinen wrote:
> 
> 
> On 04/06/15 19:44, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > This driver uses the same area for MTRR as for the ioremap_wc(), if
> > anything it just uses a smaller size in case MTRR reservation fails.
> > ioremap_wc() API is already used to take advantage of architecture
> > write-combining when available.
> > 
> > Convert the driver from using the x86 specific MTRR code to
> > the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
> > will avoid MTRR if write-combining is available.
> > 
> > There are a few motivations for this:
> > 
> > a) Take advantage of PAT when available
> > 
> > b) Help bury MTRR code away, MTRR is architecture specific and on
> >    x86 its replaced by PAT
> > 
> > c) Help with the goal of eventually using _PAGE_CACHE_UC over
> >    _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
> >    de33c442e titled "x86 PAT: fix performance drop for glx,
> >    use UC minus for ioremap(), ioremap_nocache() and
> >    pci_mmap_page_range()")
> > 
> > The conversion done is expressed by the following Coccinelle
> > SmPL patch, it additionally required manual intervention to
> > address all the #ifdery and removal of redundant things which
> > arch_phys_wc_add() already addresses such as verbose message
> > about when MTRR fails and doing nothing when we didn't get
> > an MTRR.
> > 
> > @ mtrr_found @
> > expression index, base, size;
> > @@
> > 
> > -index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
> > +index = arch_phys_wc_add(base, size);
> > 
> > @ mtrr_rm depends on mtrr_found @
> > expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
> > @@
> > 
> > -mtrr_del(index, base, size);
> > +arch_phys_wc_del(index);
> > 
> > @ mtrr_rm_zero_arg depends on mtrr_found @
> > expression mtrr_found.index;
> > @@
> > 
> > -mtrr_del(index, 0, 0);
> > +arch_phys_wc_del(index);
> > 
> > @ mtrr_rm_fb_info depends on mtrr_found @
> > struct fb_info *info;
> > expression mtrr_found.index;
> > @@
> > 
> > -mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
> > +arch_phys_wc_del(index);
> > 
> > @ ioremap_replace_nocache depends on mtrr_found @
> > struct fb_info *info;
> > expression base, size;
> > @@
> > 
> > -info->screen_base = ioremap_nocache(base, size);
> > +info->screen_base = ioremap_wc(base, size);
> > 
> > @ ioremap_replace_default depends on mtrr_found @
> > struct fb_info *info;
> > expression base, size;
> > @@
> > 
> > -info->screen_base = ioremap(base, size);
> > +info->screen_base = ioremap_wc(base, size);
> > 
> > Generated-by: Coccinelle SmPL
> > Cc: Toshi Kani <toshi.kani@hp.com>
> > Cc: Suresh Siddha <sbsiddha@gmail.com>
> > Cc: Ingo Molnar <mingo@elte.hu>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Juergen Gross <jgross@suse.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Andy Lutomirski <luto@amacapital.net>
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: Antonino Daplas <adaplas@gmail.com>
> > Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> > Cc: Rob Clark <robdclark@gmail.com>
> > Cc: Jingoo Han <jg1.han@samsung.com>
> > Cc: Wolfram Sang <wsa@the-dreams.de>
> > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: linux-fbdev@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> >  drivers/video/fbdev/vesafb.c | 29 ++++++++---------------------
> >  1 file changed, 8 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
> > index 3db3908..528fe91 100644
> > --- a/drivers/video/fbdev/vesafb.c
> > +++ b/drivers/video/fbdev/vesafb.c
> > @@ -19,10 +19,9 @@
> >  #include <linux/init.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/screen_info.h>
> > +#include <linux/io.h>
> >  
> >  #include <video/vga.h>
> > -#include <asm/io.h>
> > -#include <asm/mtrr.h>
> >  
> >  #define dac_reg	(0x3c8)
> >  #define dac_val	(0x3c9)
> > @@ -180,16 +179,10 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
> >  
> >  static void vesafb_destroy(struct fb_info *info)
> >  {
> > -#ifdef CONFIG_MTRR
> >  	struct vesafb_par *par = info->par;
> > -#endif
> >  
> >  	fb_dealloc_cmap(&info->cmap);
> > -
> > -#ifdef CONFIG_MTRR
> > -	if (par->wc_cookie >= 0)
> > -		mtrr_del(par->wc_cookie, 0, 0);
> > -#endif
> > +	arch_phys_wc_del(par->wc_cookie);
> >  	if (info->screen_base)
> >  		iounmap(info->screen_base);
> >  	release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
> > @@ -420,7 +413,6 @@ static int vesafb_probe(struct platform_device *dev)
> >  	request_region(0x3c0, 32, "vesafb");
> >  
> >  	if (mtrr = 3) {
> > -#ifdef CONFIG_MTRR
> >  		unsigned int temp_size = size_total;
> >  
> >  		/* Find the largest power-of-two */
> > @@ -428,18 +420,16 @@ static int vesafb_probe(struct platform_device *dev)
> >  
> >  		/* Try and find a power of two to add */
> >  		do {
> > -			par->wc_cookie = mtrr_add(vesafb_fix.smem_start,
> > -						  temp_size,
> > -						  MTRR_TYPE_WRCOMB, 1);
> > +			par->wc_cookie > > +				arch_phys_wc_add(vesafb_fix.smem_start,
> > +						 temp_size);
> >  			temp_size >>= 1;
> > -		} while (temp_size >= PAGE_SIZE && par->wc_cookie = -EINVAL);
> > -#endif
> > +		} while (temp_size >= PAGE_SIZE && par->wc_cookie < 0);
> > +
> 
> Looks like arch_phys_wc_add prints a warning if it fails, and the above
> loop may retry it many (?) times. Probably not a big issue, but may be
> somewhat confusing.

On most systems arch_phys_wc_add() won't ever run so I think that's a
fair compromise to reach as we phase out MTRR. If we really wanted
to fix this one could generalize the whole loop control stuff and use
a new arch_phys API to generalize all that code as tons of drivers
borrow the same logic. I decided this was pointless as we're phasing
this out anyway and this code will simply be a no-op on most systems
now.

Let me know if you have any other preference or ideas.

  Luis

^ permalink raw reply

* [PATCH 1/2] Staging: sm750fb: replace spaces by tabs
From: Dighe, Niranjan (N.) @ 2015-06-16  5:04 UTC (permalink / raw)
  To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com
  Cc: gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org

From: Niranjan Dighe <ndighe@visteon.com>

This patch replaces spaces by tabs at the start of the line and in
between variable declarations.

Signed-off-by: Niranjan Dighe <ndighe@visteon.com>
---
 drivers/staging/sm750fb/ddk750_dvi.h |   60 +++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_dvi.h b/drivers/staging/sm750fb/ddk750_dvi.h
index 50bcec2..c8d31f3 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.h
+++ b/drivers/staging/sm750fb/ddk750_dvi.h
@@ -4,16 +4,16 @@
 /* dvi chip stuffs structros */
 
 typedef long (*PFN_DVICTRL_INIT)(
-    unsigned char edgeSelect,
-    unsigned char busSelect,
-    unsigned char dualEdgeClkSelect,
-    unsigned char hsyncEnable,
-    unsigned char vsyncEnable,
-    unsigned char deskewEnable,
-    unsigned char deskewSetting,
-    unsigned char continuousSyncEnable,
-    unsigned char pllFilterEnable,
-    unsigned char pllFilterValue);
+	unsigned char edgeSelect,
+	unsigned char busSelect,
+	unsigned char dualEdgeClkSelect,
+	unsigned char hsyncEnable,
+	unsigned char vsyncEnable,
+	unsigned char deskewEnable,
+	unsigned char deskewSetting,
+	unsigned char continuousSyncEnable,
+	unsigned char pllFilterEnable,
+	unsigned char pllFilterValue);
 typedef void (*PFN_DVICTRL_RESETCHIP)(void);
 typedef char* (*PFN_DVICTRL_GETCHIPSTRING)(void);
 typedef unsigned short (*PFN_DVICTRL_GETVENDORID)(void);
@@ -29,16 +29,16 @@ typedef void (*PFN_DVICTRL_CLEARINTERRUPT)(void);
 /* Structure to hold all the function pointer to the DVI Controller. */
 typedef struct _dvi_ctrl_device_t
 {
-    PFN_DVICTRL_INIT                pfnInit;
-    PFN_DVICTRL_RESETCHIP           pfnResetChip;
-    PFN_DVICTRL_GETCHIPSTRING       pfnGetChipString;
-    PFN_DVICTRL_GETVENDORID         pfnGetVendorId;
-    PFN_DVICTRL_GETDEVICEID         pfnGetDeviceId;
-    PFN_DVICTRL_SETPOWER            pfnSetPower;
-    PFN_DVICTRL_HOTPLUGDETECTION    pfnEnableHotPlugDetection;
-    PFN_DVICTRL_ISCONNECTED         pfnIsConnected;
-    PFN_DVICTRL_CHECKINTERRUPT      pfnCheckInterrupt;
-    PFN_DVICTRL_CLEARINTERRUPT      pfnClearInterrupt;
+	PFN_DVICTRL_INIT		pfnInit;
+	PFN_DVICTRL_RESETCHIP		pfnResetChip;
+	PFN_DVICTRL_GETCHIPSTRING	pfnGetChipString;
+	PFN_DVICTRL_GETVENDORID		pfnGetVendorId;
+	PFN_DVICTRL_GETDEVICEID		pfnGetDeviceId;
+	PFN_DVICTRL_SETPOWER		pfnSetPower;
+	PFN_DVICTRL_HOTPLUGDETECTION	pfnEnableHotPlugDetection;
+	PFN_DVICTRL_ISCONNECTED		pfnIsConnected;
+	PFN_DVICTRL_CHECKINTERRUPT	pfnCheckInterrupt;
+	PFN_DVICTRL_CLEARINTERRUPT	pfnClearInterrupt;
 } dvi_ctrl_device_t;
 #define DVI_CTRL_SII164
 
@@ -46,16 +46,16 @@ typedef struct _dvi_ctrl_device_t
 
 /* dvi functions prototype */
 int dviInit(
-    unsigned char edgeSelect,
-    unsigned char busSelect,
-    unsigned char dualEdgeClkSelect,
-    unsigned char hsyncEnable,
-    unsigned char vsyncEnable,
-    unsigned char deskewEnable,
-    unsigned char deskewSetting,
-    unsigned char continuousSyncEnable,
-    unsigned char pllFilterEnable,
-    unsigned char pllFilterValue
+	unsigned char edgeSelect,
+	unsigned char busSelect,
+	unsigned char dualEdgeClkSelect,
+	unsigned char hsyncEnable,
+	unsigned char vsyncEnable,
+	unsigned char deskewEnable,
+	unsigned char deskewSetting,
+	unsigned char continuousSyncEnable,
+	unsigned char pllFilterEnable,
+	unsigned char pllFilterValue
 );
 
 unsigned short dviGetVendorID(void);
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 2/2] Staging: sm750fb: correct spacing between lines of code
From: Dighe, Niranjan (N.) @ 2015-06-16  5:05 UTC (permalink / raw)
  To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com
  Cc: gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org

From: Niranjan Dighe <ndighe@visteon.com>

This patch corrects line spacing by removing and adding newline
characters wherever necessary

Signed-off-by: Niranjan Dighe <ndighe@visteon.com>
---
 drivers/staging/sm750fb/ddk750_dvi.h |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_dvi.h b/drivers/staging/sm750fb/ddk750_dvi.h
index c8d31f3..83bbd6d 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.h
+++ b/drivers/staging/sm750fb/ddk750_dvi.h
@@ -14,6 +14,7 @@ typedef long (*PFN_DVICTRL_INIT)(
 	unsigned char continuousSyncEnable,
 	unsigned char pllFilterEnable,
 	unsigned char pllFilterValue);
+
 typedef void (*PFN_DVICTRL_RESETCHIP)(void);
 typedef char* (*PFN_DVICTRL_GETCHIPSTRING)(void);
 typedef unsigned short (*PFN_DVICTRL_GETVENDORID)(void);
@@ -24,8 +25,6 @@ typedef unsigned char (*PFN_DVICTRL_ISCONNECTED)(void);
 typedef unsigned char (*PFN_DVICTRL_CHECKINTERRUPT)(void);
 typedef void (*PFN_DVICTRL_CLEARINTERRUPT)(void);
 
-
-
 /* Structure to hold all the function pointer to the DVI Controller. */
 typedef struct _dvi_ctrl_device_t
 {
@@ -40,9 +39,8 @@ typedef struct _dvi_ctrl_device_t
 	PFN_DVICTRL_CHECKINTERRUPT	pfnCheckInterrupt;
 	PFN_DVICTRL_CLEARINTERRUPT	pfnClearInterrupt;
 } dvi_ctrl_device_t;
-#define DVI_CTRL_SII164
-
 
+#define DVI_CTRL_SII164
 
 /* dvi functions prototype */
 int dviInit(
@@ -61,7 +59,5 @@ int dviInit(
 unsigned short dviGetVendorID(void);
 unsigned short dviGetDeviceID(void);
 
-
-
 #endif
 
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH v4 3/3] video: fbdev: vesafb: use arch_phys_wc_add()
From: Tomi Valkeinen @ 2015-06-16  6:43 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis R. Rodriguez, plagnioj, bp, hpa, linux-fbdev, luto,
	toshi.kani, sbsiddha, mingo, tglx, jgross, daniel.vetter, airlied,
	adaplas, robdclark, jg1.han, wsa, linux-kernel
In-Reply-To: <20150615222750.GF11147@wotan.suse.de>

[-- Attachment #1: Type: text/plain, Size: 6362 bytes --]



On 16/06/15 01:27, Luis R. Rodriguez wrote:
> On Fri, Jun 12, 2015 at 12:04:14PM +0300, Tomi Valkeinen wrote:
>>
>>
>> On 04/06/15 19:44, Luis R. Rodriguez wrote:
>>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>>
>>> This driver uses the same area for MTRR as for the ioremap_wc(), if
>>> anything it just uses a smaller size in case MTRR reservation fails.
>>> ioremap_wc() API is already used to take advantage of architecture
>>> write-combining when available.
>>>
>>> Convert the driver from using the x86 specific MTRR code to
>>> the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
>>> will avoid MTRR if write-combining is available.
>>>
>>> There are a few motivations for this:
>>>
>>> a) Take advantage of PAT when available
>>>
>>> b) Help bury MTRR code away, MTRR is architecture specific and on
>>>    x86 its replaced by PAT
>>>
>>> c) Help with the goal of eventually using _PAGE_CACHE_UC over
>>>    _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
>>>    de33c442e titled "x86 PAT: fix performance drop for glx,
>>>    use UC minus for ioremap(), ioremap_nocache() and
>>>    pci_mmap_page_range()")
>>>
>>> The conversion done is expressed by the following Coccinelle
>>> SmPL patch, it additionally required manual intervention to
>>> address all the #ifdery and removal of redundant things which
>>> arch_phys_wc_add() already addresses such as verbose message
>>> about when MTRR fails and doing nothing when we didn't get
>>> an MTRR.
>>>
>>> @ mtrr_found @
>>> expression index, base, size;
>>> @@
>>>
>>> -index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
>>> +index = arch_phys_wc_add(base, size);
>>>
>>> @ mtrr_rm depends on mtrr_found @
>>> expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
>>> @@
>>>
>>> -mtrr_del(index, base, size);
>>> +arch_phys_wc_del(index);
>>>
>>> @ mtrr_rm_zero_arg depends on mtrr_found @
>>> expression mtrr_found.index;
>>> @@
>>>
>>> -mtrr_del(index, 0, 0);
>>> +arch_phys_wc_del(index);
>>>
>>> @ mtrr_rm_fb_info depends on mtrr_found @
>>> struct fb_info *info;
>>> expression mtrr_found.index;
>>> @@
>>>
>>> -mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
>>> +arch_phys_wc_del(index);
>>>
>>> @ ioremap_replace_nocache depends on mtrr_found @
>>> struct fb_info *info;
>>> expression base, size;
>>> @@
>>>
>>> -info->screen_base = ioremap_nocache(base, size);
>>> +info->screen_base = ioremap_wc(base, size);
>>>
>>> @ ioremap_replace_default depends on mtrr_found @
>>> struct fb_info *info;
>>> expression base, size;
>>> @@
>>>
>>> -info->screen_base = ioremap(base, size);
>>> +info->screen_base = ioremap_wc(base, size);
>>>
>>> Generated-by: Coccinelle SmPL
>>> Cc: Toshi Kani <toshi.kani@hp.com>
>>> Cc: Suresh Siddha <sbsiddha@gmail.com>
>>> Cc: Ingo Molnar <mingo@elte.hu>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>>> Cc: Andy Lutomirski <luto@amacapital.net>
>>> Cc: Dave Airlie <airlied@redhat.com>
>>> Cc: Antonino Daplas <adaplas@gmail.com>
>>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>>> Cc: Rob Clark <robdclark@gmail.com>
>>> Cc: Jingoo Han <jg1.han@samsung.com>
>>> Cc: Wolfram Sang <wsa@the-dreams.de>
>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>> Cc: linux-fbdev@vger.kernel.org
>>> Cc: linux-kernel@vger.kernel.org
>>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
>>> ---
>>>  drivers/video/fbdev/vesafb.c | 29 ++++++++---------------------
>>>  1 file changed, 8 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
>>> index 3db3908..528fe91 100644
>>> --- a/drivers/video/fbdev/vesafb.c
>>> +++ b/drivers/video/fbdev/vesafb.c
>>> @@ -19,10 +19,9 @@
>>>  #include <linux/init.h>
>>>  #include <linux/platform_device.h>
>>>  #include <linux/screen_info.h>
>>> +#include <linux/io.h>
>>>  
>>>  #include <video/vga.h>
>>> -#include <asm/io.h>
>>> -#include <asm/mtrr.h>
>>>  
>>>  #define dac_reg	(0x3c8)
>>>  #define dac_val	(0x3c9)
>>> @@ -180,16 +179,10 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
>>>  
>>>  static void vesafb_destroy(struct fb_info *info)
>>>  {
>>> -#ifdef CONFIG_MTRR
>>>  	struct vesafb_par *par = info->par;
>>> -#endif
>>>  
>>>  	fb_dealloc_cmap(&info->cmap);
>>> -
>>> -#ifdef CONFIG_MTRR
>>> -	if (par->wc_cookie >= 0)
>>> -		mtrr_del(par->wc_cookie, 0, 0);
>>> -#endif
>>> +	arch_phys_wc_del(par->wc_cookie);
>>>  	if (info->screen_base)
>>>  		iounmap(info->screen_base);
>>>  	release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
>>> @@ -420,7 +413,6 @@ static int vesafb_probe(struct platform_device *dev)
>>>  	request_region(0x3c0, 32, "vesafb");
>>>  
>>>  	if (mtrr == 3) {
>>> -#ifdef CONFIG_MTRR
>>>  		unsigned int temp_size = size_total;
>>>  
>>>  		/* Find the largest power-of-two */
>>> @@ -428,18 +420,16 @@ static int vesafb_probe(struct platform_device *dev)
>>>  
>>>  		/* Try and find a power of two to add */
>>>  		do {
>>> -			par->wc_cookie = mtrr_add(vesafb_fix.smem_start,
>>> -						  temp_size,
>>> -						  MTRR_TYPE_WRCOMB, 1);
>>> +			par->wc_cookie =
>>> +				arch_phys_wc_add(vesafb_fix.smem_start,
>>> +						 temp_size);
>>>  			temp_size >>= 1;
>>> -		} while (temp_size >= PAGE_SIZE && par->wc_cookie == -EINVAL);
>>> -#endif
>>> +		} while (temp_size >= PAGE_SIZE && par->wc_cookie < 0);
>>> +
>>
>> Looks like arch_phys_wc_add prints a warning if it fails, and the above
>> loop may retry it many (?) times. Probably not a big issue, but may be
>> somewhat confusing.
> 
> On most systems arch_phys_wc_add() won't ever run so I think that's a
> fair compromise to reach as we phase out MTRR. If we really wanted
> to fix this one could generalize the whole loop control stuff and use
> a new arch_phys API to generalize all that code as tons of drivers
> borrow the same logic. I decided this was pointless as we're phasing
> this out anyway and this code will simply be a no-op on most systems
> now.
> 
> Let me know if you have any other preference or ideas.

Ok, sounds fine to me. I'll queue these for 4.2.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] fbdev: propagate result of fb_videomode_from_videomode()
From: Tomi Valkeinen @ 2015-06-16  7:07 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1434117559-32130-1-git-send-email-vladimir.murzin@arm.com>

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]



On 12/06/15 16:59, Vladimir Murzin wrote:
> fb_videomode_from_videomode() may fail, but of_get_fb_videomode()
> silently covers this fact. Instead, trow the error code to the
> caller.
> 
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  drivers/video/fbdev/core/fbmon.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
> index 01ef1b9..d787533 100644
> --- a/drivers/video/fbdev/core/fbmon.c
> +++ b/drivers/video/fbdev/core/fbmon.c
> @@ -1475,7 +1475,9 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
>  	if (ret)
>  		return ret;
>  
> -	fb_videomode_from_videomode(&vm, fb);
> +	ret = fb_videomode_from_videomode(&vm, fb);
> +	if (ret)
> +		return ret;
>  
>  	pr_debug("%s: got %dx%d display mode from %s\n",
>  		of_node_full_name(np), vm.hactive, vm.vactive, np->name);
> 

Thanks, queued for 4.2.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [Cocci] [PATCH v3 0/4] pci: add and use pci_ioremap_wc_bar()
From: Tomi Valkeinen @ 2015-06-16  7:15 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <CAB=NE6UsMMoPhkKof+VN7ZUCd81VxrwP9nqHDUj5Lr3DJLm3bA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]



On 22/05/15 00:23, Luis R. Rodriguez wrote:
> On Wed, May 20, 2015 at 1:54 PM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
>> On Tue, May 19, 2015 at 10:53 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
>>> On Wed, Apr 29, 2015 at 02:08:47PM -0700, Luis R. Rodriguez wrote:
>>>> On Tue, Apr 21, 2015 at 1:20 PM, Luis R. Rodriguez
>>>> <mcgrof@do-not-panic.com> wrote:
>>>>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>>>>
>>>>> This series adds pci_ioremap_wc_bar() and makes use of it
>>>>> on a few framebuffer device drivers.
>>>>>
>>>>> Luis R. Rodriguez (4):
>>>>>   pci: add pci_ioremap_wc_bar()
>>>>>   video: fbdev: i740fb: use arch_phys_wc_add() and pci_ioremap_wc_bar()
>>>>>   video: fbdev: kyrofb: use arch_phys_wc_add() and pci_ioremap_wc_bar()
>>>>>   video: fbdev: gxt4500: use pci_ioremap_wc_bar() for framebuffer
>>>>
>>>> Bjorn,
>>>>
>>>> any feedback on this series?
>>>
>>> Hey Bjorn, any feedback on this series ?
>>
>> I meant this series. Also Tomi, do I get your Acks for these as well?
>> Since they depend on pci parts do you mind if we route them through
>> the PCI tree? I'll poke you soon about another similar type of patch
>> which has dependencies on another development tree.
> 
> Bjorn, Tomi, please let me know if this series is OK, if so I'll
> resubmit rebased onto Bjorn's pci tree.

For the fbdev patches:

Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* [PATCH 0/7] OMAPDSS: use components (fix probing problems)
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I noticed that on some platforms omapdss did not probe successfully. Some
resource was not available yet, but omapdss did not manage to handle deferred
probing. The reason was the use of platform_driver_probe() in combination with
how the omapdss module handles the drivers.

To fix this properly, the component system felt fine for the job, and it seems
to work nicely.

 Tomi

Tomi Valkeinen (7):
  OMAPDSS: move 'dss_initialized' to dss driver
  OMAPDSS: refactor dss probe function
  OMAPDSS: fix dss_init_ports error handling
  OMAPDSS: remove uses of __init/__exit
  OMAPDSS: reorder uninit calls
  OMAPDSS: componentize omapdss
  OMAPDSS: simplify submodule reg/unreg code

 drivers/video/fbdev/omap2/dss/core.c  |  80 ++++--------
 drivers/video/fbdev/omap2/dss/dispc.c |  42 +++++--
 drivers/video/fbdev/omap2/dss/dpi.c   |  36 ++++--
 drivers/video/fbdev/omap2/dss/dsi.c   |  27 +++-
 drivers/video/fbdev/omap2/dss/dss.c   | 223 +++++++++++++++++++++++-----------
 drivers/video/fbdev/omap2/dss/dss.h   |  32 ++---
 drivers/video/fbdev/omap2/dss/hdmi4.c |  28 ++++-
 drivers/video/fbdev/omap2/dss/hdmi5.c |  28 ++++-
 drivers/video/fbdev/omap2/dss/rfbi.c  |  32 ++++-
 drivers/video/fbdev/omap2/dss/sdi.c   |  35 ++++--
 drivers/video/fbdev/omap2/dss/venc.c  |  31 +++--
 11 files changed, 396 insertions(+), 198 deletions(-)

-- 
2.1.4


^ permalink raw reply

* [PATCH 1/7] OMAPDSS: move 'dss_initialized' to dss driver
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

We have a flag, 'dss_initialized', which tells omapfb and omapdrm if
omapdss is available. At the moment it can be set even if the dss
submodules are not all ready, in case something gets deferred.

Move the flag to dss_core driver so that it'll signal the availability
of the dss drivers move accurately.

For now, it'll signal that dss_core is ready, which is not quite correct
but still better than previously.  The following patches will add
component system to omapdss, and after those patches 'dss_initialized'
will signal that all the submodules are ready.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/core.c | 10 ----------
 drivers/video/fbdev/omap2/dss/dss.c  | 12 ++++++++++++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c
index 16751755d433..57b6a5296c87 100644
--- a/drivers/video/fbdev/omap2/dss/core.c
+++ b/drivers/video/fbdev/omap2/dss/core.c
@@ -50,8 +50,6 @@ static char *def_disp_name;
 module_param_named(def_disp, def_disp_name, charp, 0);
 MODULE_PARM_DESC(def_disp, "default display name");
 
-static bool dss_initialized;
-
 const char *omapdss_get_default_display_name(void)
 {
 	return core.default_display_name;
@@ -65,12 +63,6 @@ enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
-bool omapdss_is_initialized(void)
-{
-	return dss_initialized;
-}
-EXPORT_SYMBOL(omapdss_is_initialized);
-
 struct platform_device *dss_get_core_pdev(void)
 {
 	return core.pdev;
@@ -333,8 +325,6 @@ static int __init omap_dss_init(void)
 			dss_output_drv_loaded[i] = true;
 	}
 
-	dss_initialized = true;
-
 	return 0;
 
 err_dispc:
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 7f978b6a34e8..35601ab232e3 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -111,6 +111,14 @@ static const char * const dss_generic_clk_source_names[] = {
 	[OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI]	= "DSI_PLL2_HSDIV_DSI",
 };
 
+static bool dss_initialized;
+
+bool omapdss_is_initialized(void)
+{
+	return dss_initialized;
+}
+EXPORT_SYMBOL(omapdss_is_initialized);
+
 static inline void dss_write_reg(const struct dss_reg idx, u32 val)
 {
 	__raw_writel(val, dss.base + idx.idx);
@@ -1141,6 +1149,8 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 
 	pm_set_vt_switch(0);
 
+	dss_initialized = true;
+
 	return 0;
 
 err_pll_init:
@@ -1158,6 +1168,8 @@ err_setup_clocks:
 
 static int __exit omap_dsshw_remove(struct platform_device *pdev)
 {
+	dss_initialized = false;
+
 	if (dss.video1_pll)
 		dss_video_pll_uninit(dss.video1_pll);
 
-- 
2.1.4


^ permalink raw reply related

* [PATCH 2/7] OMAPDSS: refactor dss probe function
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

Refactor dss probe function by extracting the setup for video plls into
a separate function. The call to this function is also moved to a
slightly earlier phase, so that in error case we can bail out more
easily.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dss.c | 125 ++++++++++++++++++++----------------
 1 file changed, 69 insertions(+), 56 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 35601ab232e3..1ce47441efe3 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -1026,14 +1026,73 @@ static void __exit dss_uninit_ports(struct platform_device *pdev)
 	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
 }
 
+static int dss_video_pll_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct regulator *pll_regulator;
+	int r;
+
+	if (!np)
+		return 0;
+
+	if (of_property_read_bool(np, "syscon-pll-ctrl")) {
+		dss.syscon_pll_ctrl = syscon_regmap_lookup_by_phandle(np,
+			"syscon-pll-ctrl");
+		if (IS_ERR(dss.syscon_pll_ctrl)) {
+			dev_err(&pdev->dev,
+				"failed to get syscon-pll-ctrl regmap\n");
+			return PTR_ERR(dss.syscon_pll_ctrl);
+		}
+
+		if (of_property_read_u32_index(np, "syscon-pll-ctrl", 1,
+				&dss.syscon_pll_ctrl_offset)) {
+			dev_err(&pdev->dev,
+				"failed to get syscon-pll-ctrl offset\n");
+			return -EINVAL;
+		}
+	}
+
+	pll_regulator = devm_regulator_get(&pdev->dev, "vdda_video");
+	if (IS_ERR(pll_regulator)) {
+		r = PTR_ERR(pll_regulator);
+
+		switch (r) {
+		case -ENOENT:
+			pll_regulator = NULL;
+			break;
+
+		case -EPROBE_DEFER:
+			return -EPROBE_DEFER;
+
+		default:
+			DSSERR("can't get DPLL VDDA regulator\n");
+			return r;
+		}
+	}
+
+	if (of_property_match_string(np, "reg-names", "pll1") >= 0) {
+		dss.video1_pll = dss_video_pll_init(pdev, 0, pll_regulator);
+		if (IS_ERR(dss.video1_pll))
+			return PTR_ERR(dss.video1_pll);
+	}
+
+	if (of_property_match_string(np, "reg-names", "pll2") >= 0) {
+		dss.video2_pll = dss_video_pll_init(pdev, 1, pll_regulator);
+		if (IS_ERR(dss.video2_pll)) {
+			dss_video_pll_uninit(dss.video1_pll);
+			return PTR_ERR(dss.video2_pll);
+		}
+	}
+
+	return 0;
+}
+
 /* DSS HW IP initialisation */
 static int __init omap_dsshw_probe(struct platform_device *pdev)
 {
 	struct resource *dss_mem;
-	struct device_node *np = pdev->dev.of_node;
 	u32 rev;
 	int r;
-	struct regulator *pll_regulator;
 
 	dss.pdev = pdev;
 
@@ -1062,6 +1121,10 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 	if (r)
 		goto err_setup_clocks;
 
+	r = dss_video_pll_probe(pdev);
+	if (r)
+		goto err_pll_init;
+
 	pm_runtime_enable(&pdev->dev);
 
 	r = dss_runtime_get();
@@ -1088,57 +1151,6 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 
 	dss_init_ports(pdev);
 
-	if (np && of_property_read_bool(np, "syscon-pll-ctrl")) {
-		dss.syscon_pll_ctrl = syscon_regmap_lookup_by_phandle(np,
-			"syscon-pll-ctrl");
-		if (IS_ERR(dss.syscon_pll_ctrl)) {
-			dev_err(&pdev->dev,
-				"failed to get syscon-pll-ctrl regmap\n");
-			return PTR_ERR(dss.syscon_pll_ctrl);
-		}
-
-		if (of_property_read_u32_index(np, "syscon-pll-ctrl", 1,
-				&dss.syscon_pll_ctrl_offset)) {
-			dev_err(&pdev->dev,
-				"failed to get syscon-pll-ctrl offset\n");
-			return -EINVAL;
-		}
-	}
-
-	pll_regulator = devm_regulator_get(&pdev->dev, "vdda_video");
-	if (IS_ERR(pll_regulator)) {
-		r = PTR_ERR(pll_regulator);
-
-		switch (r) {
-		case -ENOENT:
-			pll_regulator = NULL;
-			break;
-
-		case -EPROBE_DEFER:
-			return -EPROBE_DEFER;
-
-		default:
-			DSSERR("can't get DPLL VDDA regulator\n");
-			return r;
-		}
-	}
-
-	if (of_property_match_string(np, "reg-names", "pll1") >= 0) {
-		dss.video1_pll = dss_video_pll_init(pdev, 0, pll_regulator);
-		if (IS_ERR(dss.video1_pll)) {
-			r = PTR_ERR(dss.video1_pll);
-			goto err_pll_init;
-		}
-	}
-
-	if (of_property_match_string(np, "reg-names", "pll2") >= 0) {
-		dss.video2_pll = dss_video_pll_init(pdev, 1, pll_regulator);
-		if (IS_ERR(dss.video2_pll)) {
-			r = PTR_ERR(dss.video2_pll);
-			goto err_pll_init;
-		}
-	}
-
 	rev = dss_read_reg(DSS_REVISION);
 	printk(KERN_INFO "OMAP DSS rev %d.%d\n",
 			FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
@@ -1153,14 +1165,15 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_pll_init:
+err_runtime_get:
+	pm_runtime_disable(&pdev->dev);
+
 	if (dss.video1_pll)
 		dss_video_pll_uninit(dss.video1_pll);
 
 	if (dss.video2_pll)
 		dss_video_pll_uninit(dss.video2_pll);
-err_runtime_get:
-	pm_runtime_disable(&pdev->dev);
+err_pll_init:
 err_setup_clocks:
 	dss_put_clocks();
 	return r;
-- 
2.1.4


^ permalink raw reply related

* [PATCH 3/7] OMAPDSS: fix dss_init_ports error handling
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

The return value of dss_init_ports() is not handled at all, causing
crashes later if the call failed.

This patch adds the error handling, and we also move the call to a
slightly earlier place to make bailing out easier.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dss.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 1ce47441efe3..28e6ff053b47 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -1125,6 +1125,10 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 	if (r)
 		goto err_pll_init;
 
+	r = dss_init_ports(pdev);
+	if (r)
+		goto err_init_ports;
+
 	pm_runtime_enable(&pdev->dev);
 
 	r = dss_runtime_get();
@@ -1149,8 +1153,6 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 	dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK;
 	dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK;
 
-	dss_init_ports(pdev);
-
 	rev = dss_read_reg(DSS_REVISION);
 	printk(KERN_INFO "OMAP DSS rev %d.%d\n",
 			FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
@@ -1167,7 +1169,8 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 
 err_runtime_get:
 	pm_runtime_disable(&pdev->dev);
-
+	dss_uninit_ports(pdev);
+err_init_ports:
 	if (dss.video1_pll)
 		dss_video_pll_uninit(dss.video1_pll);
 
-- 
2.1.4


^ permalink raw reply related

* [PATCH 4/7] OMAPDSS: remove uses of __init/__exit
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

The following patches will add component handling to omapdss, improving
the handling of deferred probing. However, at the moment we're using
quite a lot of __inits and __exits in the driver, which prevent normal
dynamic probing and removal.

This patch removes most of the uses of __init and __exit.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dispc.c | 20 ++++++++++----------
 drivers/video/fbdev/omap2/dss/dpi.c   | 14 +++++++-------
 drivers/video/fbdev/omap2/dss/dsi.c   |  6 +++---
 drivers/video/fbdev/omap2/dss/dss.c   | 26 +++++++++++++-------------
 drivers/video/fbdev/omap2/dss/dss.h   | 32 ++++++++++++++++----------------
 drivers/video/fbdev/omap2/dss/hdmi4.c |  6 +++---
 drivers/video/fbdev/omap2/dss/hdmi5.c |  6 +++---
 drivers/video/fbdev/omap2/dss/rfbi.c  |  8 ++++----
 drivers/video/fbdev/omap2/dss/sdi.c   | 12 ++++++------
 drivers/video/fbdev/omap2/dss/venc.c  |  8 ++++----
 10 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index f4fc77d9d3bf..e3417af63451 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -3692,7 +3692,7 @@ static void _omap_dispc_initial_config(void)
 		dispc_init_mflag();
 }
 
-static const struct dispc_features omap24xx_dispc_feats __initconst = {
+static const struct dispc_features omap24xx_dispc_feats = {
 	.sw_start		=	5,
 	.fp_start		=	15,
 	.bp_start		=	27,
@@ -3711,7 +3711,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.set_max_preload	=	false,
 };
 
-static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
+static const struct dispc_features omap34xx_rev1_0_dispc_feats = {
 	.sw_start		=	5,
 	.fp_start		=	15,
 	.bp_start		=	27,
@@ -3731,7 +3731,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.set_max_preload	=	false,
 };
 
-static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
+static const struct dispc_features omap34xx_rev3_0_dispc_feats = {
 	.sw_start		=	7,
 	.fp_start		=	19,
 	.bp_start		=	31,
@@ -3751,7 +3751,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.set_max_preload	=	false,
 };
 
-static const struct dispc_features omap44xx_dispc_feats __initconst = {
+static const struct dispc_features omap44xx_dispc_feats = {
 	.sw_start		=	7,
 	.fp_start		=	19,
 	.bp_start		=	31,
@@ -3771,7 +3771,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.set_max_preload	=	true,
 };
 
-static const struct dispc_features omap54xx_dispc_feats __initconst = {
+static const struct dispc_features omap54xx_dispc_feats = {
 	.sw_start		=	7,
 	.fp_start		=	19,
 	.bp_start		=	31,
@@ -3792,7 +3792,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.set_max_preload	=	true,
 };
 
-static int __init dispc_init_features(struct platform_device *pdev)
+static int dispc_init_features(struct platform_device *pdev)
 {
 	const struct dispc_features *src;
 	struct dispc_features *dst;
@@ -3882,7 +3882,7 @@ void dispc_free_irq(void *dev_id)
 EXPORT_SYMBOL(dispc_free_irq);
 
 /* DISPC HW IP initialisation */
-static int __init omap_dispchw_probe(struct platform_device *pdev)
+static int omap_dispchw_probe(struct platform_device *pdev)
 {
 	u32 rev;
 	int r = 0;
@@ -3955,7 +3955,7 @@ err_runtime_get:
 	return r;
 }
 
-static int __exit omap_dispchw_remove(struct platform_device *pdev)
+static int omap_dispchw_remove(struct platform_device *pdev)
 {
 	pm_runtime_disable(&pdev->dev);
 
@@ -4013,7 +4013,7 @@ static const struct of_device_id dispc_of_match[] = {
 };
 
 static struct platform_driver omap_dispchw_driver = {
-	.remove         = __exit_p(omap_dispchw_remove),
+	.remove         = omap_dispchw_remove,
 	.driver         = {
 		.name   = "omapdss_dispc",
 		.pm	= &dispc_pm_ops,
@@ -4027,7 +4027,7 @@ int __init dispc_init_platform_driver(void)
 	return platform_driver_probe(&omap_dispchw_driver, omap_dispchw_probe);
 }
 
-void __exit dispc_uninit_platform_driver(void)
+void dispc_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_dispchw_driver);
 }
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index f83e7b030249..a06e7558280f 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -731,7 +731,7 @@ static void dpi_init_output(struct platform_device *pdev)
 	omapdss_register_output(out);
 }
 
-static void __exit dpi_uninit_output(struct platform_device *pdev)
+static void dpi_uninit_output(struct platform_device *pdev)
 {
 	struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
 	struct omap_dss_device *out = &dpi->output;
@@ -775,7 +775,7 @@ static void dpi_init_output_port(struct platform_device *pdev,
 	omapdss_register_output(out);
 }
 
-static void __exit dpi_uninit_output_port(struct device_node *port)
+static void dpi_uninit_output_port(struct device_node *port)
 {
 	struct dpi_data *dpi = port->data;
 	struct omap_dss_device *out = &dpi->output;
@@ -802,7 +802,7 @@ static int omap_dpi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __exit omap_dpi_remove(struct platform_device *pdev)
+static int omap_dpi_remove(struct platform_device *pdev)
 {
 	dpi_uninit_output(pdev);
 
@@ -811,7 +811,7 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
 
 static struct platform_driver omap_dpi_driver = {
 	.probe		= omap_dpi_probe,
-	.remove         = __exit_p(omap_dpi_remove),
+	.remove         = omap_dpi_remove,
 	.driver         = {
 		.name   = "omapdss_dpi",
 		.suppress_bind_attrs = true,
@@ -823,12 +823,12 @@ int __init dpi_init_platform_driver(void)
 	return platform_driver_register(&omap_dpi_driver);
 }
 
-void __exit dpi_uninit_platform_driver(void)
+void dpi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_dpi_driver);
 }
 
-int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
+int dpi_init_port(struct platform_device *pdev, struct device_node *port)
 {
 	struct dpi_data *dpi;
 	struct device_node *ep;
@@ -870,7 +870,7 @@ err_datalines:
 	return r;
 }
 
-void __exit dpi_uninit_port(struct device_node *port)
+void dpi_uninit_port(struct device_node *port)
 {
 	struct dpi_data *dpi = port->data;
 
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index 28b0bc11669d..c4c27c09c62f 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -5484,7 +5484,7 @@ err_runtime_get:
 	return r;
 }
 
-static int __exit omap_dsihw_remove(struct platform_device *dsidev)
+static int omap_dsihw_remove(struct platform_device *dsidev)
 {
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
@@ -5570,7 +5570,7 @@ static const struct of_device_id dsi_of_match[] = {
 
 static struct platform_driver omap_dsihw_driver = {
 	.probe		= omap_dsihw_probe,
-	.remove         = __exit_p(omap_dsihw_remove),
+	.remove         = omap_dsihw_remove,
 	.driver         = {
 		.name   = "omapdss_dsi",
 		.pm	= &dsi_pm_ops,
@@ -5584,7 +5584,7 @@ int __init dsi_init_platform_driver(void)
 	return platform_driver_register(&omap_dsihw_driver);
 }
 
-void __exit dsi_uninit_platform_driver(void)
+void dsi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_dsihw_driver);
 }
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 28e6ff053b47..3397cbf484b0 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -819,7 +819,7 @@ static const enum omap_display_type dra7xx_ports[] = {
 	OMAP_DISPLAY_TYPE_DPI,
 };
 
-static const struct dss_features omap24xx_dss_feats __initconst = {
+static const struct dss_features omap24xx_dss_feats = {
 	/*
 	 * fck div max is really 16, but the divider range has gaps. The range
 	 * from 1 to 6 has no gaps, so let's use that as a max.
@@ -832,7 +832,7 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 };
 
-static const struct dss_features omap34xx_dss_feats __initconst = {
+static const struct dss_features omap34xx_dss_feats = {
 	.fck_div_max		=	16,
 	.dss_fck_multiplier	=	2,
 	.parent_clk_name	=	"dpll4_ck",
@@ -841,7 +841,7 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap34xx_ports),
 };
 
-static const struct dss_features omap3630_dss_feats __initconst = {
+static const struct dss_features omap3630_dss_feats = {
 	.fck_div_max		=	32,
 	.dss_fck_multiplier	=	1,
 	.parent_clk_name	=	"dpll4_ck",
@@ -850,7 +850,7 @@ static const struct dss_features omap3630_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 };
 
-static const struct dss_features omap44xx_dss_feats __initconst = {
+static const struct dss_features omap44xx_dss_feats = {
 	.fck_div_max		=	32,
 	.dss_fck_multiplier	=	1,
 	.parent_clk_name	=	"dpll_per_x2_ck",
@@ -859,7 +859,7 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 };
 
-static const struct dss_features omap54xx_dss_feats __initconst = {
+static const struct dss_features omap54xx_dss_feats = {
 	.fck_div_max		=	64,
 	.dss_fck_multiplier	=	1,
 	.parent_clk_name	=	"dpll_per_x2_ck",
@@ -868,7 +868,7 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 };
 
-static const struct dss_features am43xx_dss_feats __initconst = {
+static const struct dss_features am43xx_dss_feats = {
 	.fck_div_max		=	0,
 	.dss_fck_multiplier	=	0,
 	.parent_clk_name	=	NULL,
@@ -877,7 +877,7 @@ static const struct dss_features am43xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 };
 
-static const struct dss_features dra7xx_dss_feats __initconst = {
+static const struct dss_features dra7xx_dss_feats = {
 	.fck_div_max		=	64,
 	.dss_fck_multiplier	=	1,
 	.parent_clk_name	=	"dpll_per_x2_ck",
@@ -886,7 +886,7 @@ static const struct dss_features dra7xx_dss_feats __initconst = {
 	.num_ports		=	ARRAY_SIZE(dra7xx_ports),
 };
 
-static int __init dss_init_features(struct platform_device *pdev)
+static int dss_init_features(struct platform_device *pdev)
 {
 	const struct dss_features *src;
 	struct dss_features *dst;
@@ -940,7 +940,7 @@ static int __init dss_init_features(struct platform_device *pdev)
 	return 0;
 }
 
-static int __init dss_init_ports(struct platform_device *pdev)
+static int dss_init_ports(struct platform_device *pdev)
 {
 	struct device_node *parent = pdev->dev.of_node;
 	struct device_node *port;
@@ -984,7 +984,7 @@ static int __init dss_init_ports(struct platform_device *pdev)
 	return 0;
 }
 
-static void __exit dss_uninit_ports(struct platform_device *pdev)
+static void dss_uninit_ports(struct platform_device *pdev)
 {
 	struct device_node *parent = pdev->dev.of_node;
 	struct device_node *port;
@@ -1088,7 +1088,7 @@ static int dss_video_pll_probe(struct platform_device *pdev)
 }
 
 /* DSS HW IP initialisation */
-static int __init omap_dsshw_probe(struct platform_device *pdev)
+static int omap_dsshw_probe(struct platform_device *pdev)
 {
 	struct resource *dss_mem;
 	u32 rev;
@@ -1182,7 +1182,7 @@ err_setup_clocks:
 	return r;
 }
 
-static int __exit omap_dsshw_remove(struct platform_device *pdev)
+static int omap_dsshw_remove(struct platform_device *pdev)
 {
 	dss_initialized = false;
 
@@ -1243,7 +1243,7 @@ static const struct of_device_id dss_of_match[] = {
 MODULE_DEVICE_TABLE(of, dss_of_match);
 
 static struct platform_driver omap_dsshw_driver = {
-	.remove         = __exit_p(omap_dsshw_remove),
+	.remove         = omap_dsshw_remove,
 	.driver         = {
 		.name   = "omapdss_dss",
 		.pm	= &dss_pm_ops,
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 4812eee2622a..2406bcdb831a 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -309,18 +309,18 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
 
 /* SDI */
 int sdi_init_platform_driver(void) __init;
-void sdi_uninit_platform_driver(void) __exit;
+void sdi_uninit_platform_driver(void);
 
 #ifdef CONFIG_OMAP2_DSS_SDI
-int sdi_init_port(struct platform_device *pdev, struct device_node *port) __init;
-void sdi_uninit_port(struct device_node *port) __exit;
+int sdi_init_port(struct platform_device *pdev, struct device_node *port);
+void sdi_uninit_port(struct device_node *port);
 #else
-static inline int __init sdi_init_port(struct platform_device *pdev,
+static inline int sdi_init_port(struct platform_device *pdev,
 		struct device_node *port)
 {
 	return 0;
 }
-static inline void __exit sdi_uninit_port(struct device_node *port)
+static inline void sdi_uninit_port(struct device_node *port)
 {
 }
 #endif
@@ -333,7 +333,7 @@ struct dentry;
 struct file_operations;
 
 int dsi_init_platform_driver(void) __init;
-void dsi_uninit_platform_driver(void) __exit;
+void dsi_uninit_platform_driver(void);
 
 void dsi_dump_clocks(struct seq_file *s);
 
@@ -350,25 +350,25 @@ static inline u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt)
 
 /* DPI */
 int dpi_init_platform_driver(void) __init;
-void dpi_uninit_platform_driver(void) __exit;
+void dpi_uninit_platform_driver(void);
 
 #ifdef CONFIG_OMAP2_DSS_DPI
-int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
-void dpi_uninit_port(struct device_node *port) __exit;
+int dpi_init_port(struct platform_device *pdev, struct device_node *port);
+void dpi_uninit_port(struct device_node *port);
 #else
-static inline int __init dpi_init_port(struct platform_device *pdev,
+static inline int dpi_init_port(struct platform_device *pdev,
 		struct device_node *port)
 {
 	return 0;
 }
-static inline void __exit dpi_uninit_port(struct device_node *port)
+static inline void dpi_uninit_port(struct device_node *port)
 {
 }
 #endif
 
 /* DISPC */
 int dispc_init_platform_driver(void) __init;
-void dispc_uninit_platform_driver(void) __exit;
+void dispc_uninit_platform_driver(void);
 void dispc_dump_clocks(struct seq_file *s);
 
 void dispc_enable_sidle(void);
@@ -418,18 +418,18 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
 
 /* VENC */
 int venc_init_platform_driver(void) __init;
-void venc_uninit_platform_driver(void) __exit;
+void venc_uninit_platform_driver(void);
 
 /* HDMI */
 int hdmi4_init_platform_driver(void) __init;
-void hdmi4_uninit_platform_driver(void) __exit;
+void hdmi4_uninit_platform_driver(void);
 
 int hdmi5_init_platform_driver(void) __init;
-void hdmi5_uninit_platform_driver(void) __exit;
+void hdmi5_uninit_platform_driver(void);
 
 /* RFBI */
 int rfbi_init_platform_driver(void) __init;
-void rfbi_uninit_platform_driver(void) __exit;
+void rfbi_uninit_platform_driver(void);
 
 
 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 916d47978f41..31deebbc32dc 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -713,7 +713,7 @@ err:
 	return r;
 }
 
-static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
+static int omapdss_hdmihw_remove(struct platform_device *pdev)
 {
 	if (hdmi.audio_pdev)
 		platform_device_unregister(hdmi.audio_pdev);
@@ -757,7 +757,7 @@ static const struct of_device_id hdmi_of_match[] = {
 
 static struct platform_driver omapdss_hdmihw_driver = {
 	.probe		= omapdss_hdmihw_probe,
-	.remove         = __exit_p(omapdss_hdmihw_remove),
+	.remove         = omapdss_hdmihw_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi",
 		.pm	= &hdmi_pm_ops,
@@ -771,7 +771,7 @@ int __init hdmi4_init_platform_driver(void)
 	return platform_driver_register(&omapdss_hdmihw_driver);
 }
 
-void __exit hdmi4_uninit_platform_driver(void)
+void hdmi4_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omapdss_hdmihw_driver);
 }
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 3f0b34a7031a..a57f5e8f9aea 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -748,7 +748,7 @@ err:
 	return r;
 }
 
-static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
+static int omapdss_hdmihw_remove(struct platform_device *pdev)
 {
 	if (hdmi.audio_pdev)
 		platform_device_unregister(hdmi.audio_pdev);
@@ -793,7 +793,7 @@ static const struct of_device_id hdmi_of_match[] = {
 
 static struct platform_driver omapdss_hdmihw_driver = {
 	.probe		= omapdss_hdmihw_probe,
-	.remove         = __exit_p(omapdss_hdmihw_remove),
+	.remove         = omapdss_hdmihw_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi5",
 		.pm	= &hdmi_pm_ops,
@@ -807,7 +807,7 @@ int __init hdmi5_init_platform_driver(void)
 	return platform_driver_register(&omapdss_hdmihw_driver);
 }
 
-void __exit hdmi5_uninit_platform_driver(void)
+void hdmi5_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omapdss_hdmihw_driver);
 }
diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/video/fbdev/omap2/dss/rfbi.c
index 065effca9236..8ec810bce0b6 100644
--- a/drivers/video/fbdev/omap2/dss/rfbi.c
+++ b/drivers/video/fbdev/omap2/dss/rfbi.c
@@ -938,7 +938,7 @@ static void rfbi_init_output(struct platform_device *pdev)
 	omapdss_register_output(out);
 }
 
-static void __exit rfbi_uninit_output(struct platform_device *pdev)
+static void rfbi_uninit_output(struct platform_device *pdev)
 {
 	struct omap_dss_device *out = &rfbi.output;
 
@@ -1005,7 +1005,7 @@ err_runtime_get:
 	return r;
 }
 
-static int __exit omap_rfbihw_remove(struct platform_device *pdev)
+static int omap_rfbihw_remove(struct platform_device *pdev)
 {
 	rfbi_uninit_output(pdev);
 
@@ -1039,7 +1039,7 @@ static const struct dev_pm_ops rfbi_pm_ops = {
 
 static struct platform_driver omap_rfbihw_driver = {
 	.probe		= omap_rfbihw_probe,
-	.remove         = __exit_p(omap_rfbihw_remove),
+	.remove         = omap_rfbihw_remove,
 	.driver         = {
 		.name   = "omapdss_rfbi",
 		.pm	= &rfbi_pm_ops,
@@ -1052,7 +1052,7 @@ int __init rfbi_init_platform_driver(void)
 	return platform_driver_register(&omap_rfbihw_driver);
 }
 
-void __exit rfbi_uninit_platform_driver(void)
+void rfbi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_rfbihw_driver);
 }
diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index 5c2ccab5a958..a873118f1e0e 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -350,7 +350,7 @@ static void sdi_init_output(struct platform_device *pdev)
 	omapdss_register_output(out);
 }
 
-static void __exit sdi_uninit_output(struct platform_device *pdev)
+static void sdi_uninit_output(struct platform_device *pdev)
 {
 	struct omap_dss_device *out = &sdi.output;
 
@@ -366,7 +366,7 @@ static int omap_sdi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __exit omap_sdi_remove(struct platform_device *pdev)
+static int omap_sdi_remove(struct platform_device *pdev)
 {
 	sdi_uninit_output(pdev);
 
@@ -375,7 +375,7 @@ static int __exit omap_sdi_remove(struct platform_device *pdev)
 
 static struct platform_driver omap_sdi_driver = {
 	.probe		= omap_sdi_probe,
-	.remove         = __exit_p(omap_sdi_remove),
+	.remove         = omap_sdi_remove,
 	.driver         = {
 		.name   = "omapdss_sdi",
 		.suppress_bind_attrs = true,
@@ -387,12 +387,12 @@ int __init sdi_init_platform_driver(void)
 	return platform_driver_register(&omap_sdi_driver);
 }
 
-void __exit sdi_uninit_platform_driver(void)
+void sdi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_sdi_driver);
 }
 
-int __init sdi_init_port(struct platform_device *pdev, struct device_node *port)
+int sdi_init_port(struct platform_device *pdev, struct device_node *port)
 {
 	struct device_node *ep;
 	u32 datapairs;
@@ -426,7 +426,7 @@ err_datapairs:
 	return r;
 }
 
-void __exit sdi_uninit_port(struct device_node *port)
+void sdi_uninit_port(struct device_node *port)
 {
 	if (!sdi.port_initialized)
 		return;
diff --git a/drivers/video/fbdev/omap2/dss/venc.c b/drivers/video/fbdev/omap2/dss/venc.c
index ef7fd925e7f2..e7fad0e19d43 100644
--- a/drivers/video/fbdev/omap2/dss/venc.c
+++ b/drivers/video/fbdev/omap2/dss/venc.c
@@ -802,7 +802,7 @@ static void venc_init_output(struct platform_device *pdev)
 	omapdss_register_output(out);
 }
 
-static void __exit venc_uninit_output(struct platform_device *pdev)
+static void venc_uninit_output(struct platform_device *pdev)
 {
 	struct omap_dss_device *out = &venc.output;
 
@@ -912,7 +912,7 @@ err_runtime_get:
 	return r;
 }
 
-static int __exit omap_venchw_remove(struct platform_device *pdev)
+static int omap_venchw_remove(struct platform_device *pdev)
 {
 	venc_uninit_output(pdev);
 
@@ -960,7 +960,7 @@ static const struct of_device_id venc_of_match[] = {
 
 static struct platform_driver omap_venchw_driver = {
 	.probe		= omap_venchw_probe,
-	.remove         = __exit_p(omap_venchw_remove),
+	.remove         = omap_venchw_remove,
 	.driver         = {
 		.name   = "omapdss_venc",
 		.pm	= &venc_pm_ops,
@@ -974,7 +974,7 @@ int __init venc_init_platform_driver(void)
 	return platform_driver_register(&omap_venchw_driver);
 }
 
-void __exit venc_uninit_platform_driver(void)
+void venc_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_venchw_driver);
 }
-- 
2.1.4


^ permalink raw reply related

* [PATCH 5/7] OMAPDSS: reorder uninit calls
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

We have a list of function pointers to dss submodule uninit functions.
It makes sense to do the uninit in the reverse order to init, but that
is not currently the case.

This patch reorders the uninit calls to be the reverse of init order.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/core.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c
index 57b6a5296c87..5c64515de818 100644
--- a/drivers/video/fbdev/omap2/dss/core.c
+++ b/drivers/video/fbdev/omap2/dss/core.c
@@ -269,26 +269,26 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = {
 };
 
 static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = {
-#ifdef CONFIG_OMAP2_DSS_DSI
-	dsi_uninit_platform_driver,
+#ifdef CONFIG_OMAP5_DSS_HDMI
+	hdmi5_uninit_platform_driver,
 #endif
-#ifdef CONFIG_OMAP2_DSS_DPI
-	dpi_uninit_platform_driver,
+#ifdef CONFIG_OMAP4_DSS_HDMI
+	hdmi4_uninit_platform_driver,
 #endif
-#ifdef CONFIG_OMAP2_DSS_SDI
-	sdi_uninit_platform_driver,
+#ifdef CONFIG_OMAP2_DSS_VENC
+	venc_uninit_platform_driver,
 #endif
 #ifdef CONFIG_OMAP2_DSS_RFBI
 	rfbi_uninit_platform_driver,
 #endif
-#ifdef CONFIG_OMAP2_DSS_VENC
-	venc_uninit_platform_driver,
+#ifdef CONFIG_OMAP2_DSS_SDI
+	sdi_uninit_platform_driver,
 #endif
-#ifdef CONFIG_OMAP4_DSS_HDMI
-	hdmi4_uninit_platform_driver,
+#ifdef CONFIG_OMAP2_DSS_DPI
+	dpi_uninit_platform_driver,
 #endif
-#ifdef CONFIG_OMAP5_DSS_HDMI
-	hdmi5_uninit_platform_driver,
+#ifdef CONFIG_OMAP2_DSS_DSI
+	dsi_uninit_platform_driver,
 #endif
 };
 
-- 
2.1.4


^ permalink raw reply related

* [PATCH 6/7] OMAPDSS: componentize omapdss
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

omapdss kernel module contains drivers for multiple devices, one for
each DSS submodule. The probing we have at the moment is a mess, and
doesn't give us proper deferred probing nor ensure that all the devices
are probed before omapfb/omapdrm start using omapdss.

This patch solves the mess by using the component system for DSS
submodules.

The changes to all DSS submodules (dispc, dpi, dsi, hdmi4/5, rfbi, sdi,
venc) are the same: probe & remove functions are changed to bind &
unbind, and new probe & remove functions are added which call
component_add/del.

The dss_core driver (dss.c) acts as a component master. Adding and
matching the components is simple: all dss device's child devices are
added as components.

However, we do have some dependencies between the drivers. The order in
which they should be probed is reflected by the list in core.c
(dss_output_drv_reg_funcs). The drivers are registered in that order,
which causes the components to be added in that order, which makes the
components to be bound in that order. This feels a bit fragile, and we
probably should improve the code to manage binds in random order.
However, for now, this works fine.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dispc.c | 28 ++++++++++++++---
 drivers/video/fbdev/omap2/dss/dpi.c   | 26 ++++++++++++---
 drivers/video/fbdev/omap2/dss/dsi.c   | 25 ++++++++++++---
 drivers/video/fbdev/omap2/dss/dss.c   | 59 ++++++++++++++++++++++++++++++++---
 drivers/video/fbdev/omap2/dss/hdmi4.c | 26 ++++++++++++---
 drivers/video/fbdev/omap2/dss/hdmi5.c | 26 ++++++++++++---
 drivers/video/fbdev/omap2/dss/rfbi.c  | 28 ++++++++++++++---
 drivers/video/fbdev/omap2/dss/sdi.c   | 27 +++++++++++++---
 drivers/video/fbdev/omap2/dss/venc.c  | 27 +++++++++++++---
 9 files changed, 234 insertions(+), 38 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index e3417af63451..c8e34163211a 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -39,6 +39,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 
@@ -3882,8 +3883,9 @@ void dispc_free_irq(void *dev_id)
 EXPORT_SYMBOL(dispc_free_irq);
 
 /* DISPC HW IP initialisation */
-static int omap_dispchw_probe(struct platform_device *pdev)
+static int dispc_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	u32 rev;
 	int r = 0;
 	struct resource *dispc_mem;
@@ -3955,12 +3957,27 @@ err_runtime_get:
 	return r;
 }
 
-static int omap_dispchw_remove(struct platform_device *pdev)
+static void dispc_unbind(struct device *dev, struct device *master,
+			       void *data)
 {
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_disable(dev);
 
 	dss_uninit_overlay_managers();
+}
+
+static const struct component_ops dispc_component_ops = {
+	.bind	= dispc_bind,
+	.unbind	= dispc_unbind,
+};
 
+static int dispc_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &dispc_component_ops);
+}
+
+static int dispc_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &dispc_component_ops);
 	return 0;
 }
 
@@ -4013,7 +4030,8 @@ static const struct of_device_id dispc_of_match[] = {
 };
 
 static struct platform_driver omap_dispchw_driver = {
-	.remove         = omap_dispchw_remove,
+	.probe		= dispc_probe,
+	.remove         = dispc_remove,
 	.driver         = {
 		.name   = "omapdss_dispc",
 		.pm	= &dispc_pm_ops,
@@ -4024,7 +4042,7 @@ static struct platform_driver omap_dispchw_driver = {
 
 int __init dispc_init_platform_driver(void)
 {
-	return platform_driver_probe(&omap_dispchw_driver, omap_dispchw_probe);
+	return platform_driver_register(&omap_dispchw_driver);
 }
 
 void dispc_uninit_platform_driver(void)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index a06e7558280f..fb45b6432968 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -32,6 +32,7 @@
 #include <linux/string.h>
 #include <linux/of.h>
 #include <linux/clk.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 
@@ -783,8 +784,9 @@ static void dpi_uninit_output_port(struct device_node *port)
 	omapdss_unregister_output(out);
 }
 
-static int omap_dpi_probe(struct platform_device *pdev)
+static int dpi_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct dpi_data *dpi;
 
 	dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
@@ -802,16 +804,32 @@ static int omap_dpi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap_dpi_remove(struct platform_device *pdev)
+static void dpi_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	dpi_uninit_output(pdev);
+}
+
+static const struct component_ops dpi_component_ops = {
+	.bind	= dpi_bind,
+	.unbind	= dpi_unbind,
+};
 
+static int dpi_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &dpi_component_ops);
+}
+
+static int dpi_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &dpi_component_ops);
 	return 0;
 }
 
 static struct platform_driver omap_dpi_driver = {
-	.probe		= omap_dpi_probe,
-	.remove         = omap_dpi_remove,
+	.probe		= dpi_probe,
+	.remove		= dpi_remove,
 	.driver         = {
 		.name   = "omapdss_dpi",
 		.suppress_bind_attrs = true,
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index c4c27c09c62f..b3606def5b7b 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -40,6 +40,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 #include <video/mipi_display.h>
@@ -5274,8 +5275,9 @@ static int dsi_init_pll_data(struct platform_device *dsidev)
 }
 
 /* DSI1 HW IP initialisation */
-static int omap_dsihw_probe(struct platform_device *dsidev)
+static int dsi_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *dsidev = to_platform_device(dev);
 	u32 rev;
 	int r, i;
 	struct dsi_data *dsi;
@@ -5484,8 +5486,9 @@ err_runtime_get:
 	return r;
 }
 
-static int omap_dsihw_remove(struct platform_device *dsidev)
+static void dsi_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *dsidev = to_platform_device(dev);
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
 	of_platform_depopulate(&dsidev->dev);
@@ -5502,7 +5505,21 @@ static int omap_dsihw_remove(struct platform_device *dsidev)
 		regulator_disable(dsi->vdds_dsi_reg);
 		dsi->vdds_dsi_enabled = false;
 	}
+}
+
+static const struct component_ops dsi_component_ops = {
+	.bind	= dsi_bind,
+	.unbind	= dsi_unbind,
+};
 
+static int dsi_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &dsi_component_ops);
+}
+
+static int dsi_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &dsi_component_ops);
 	return 0;
 }
 
@@ -5569,8 +5586,8 @@ static const struct of_device_id dsi_of_match[] = {
 };
 
 static struct platform_driver omap_dsihw_driver = {
-	.probe		= omap_dsihw_probe,
-	.remove         = omap_dsihw_remove,
+	.probe		= dsi_probe,
+	.remove		= dsi_remove,
 	.driver         = {
 		.name   = "omapdss_dsi",
 		.pm	= &dsi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 3397cbf484b0..612b093831d5 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -39,6 +39,7 @@
 #include <linux/of.h>
 #include <linux/regulator/consumer.h>
 #include <linux/suspend.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 
@@ -1088,8 +1089,9 @@ static int dss_video_pll_probe(struct platform_device *pdev)
 }
 
 /* DSS HW IP initialisation */
-static int omap_dsshw_probe(struct platform_device *pdev)
+static int dss_bind(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct resource *dss_mem;
 	u32 rev;
 	int r;
@@ -1159,6 +1161,10 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 
 	dss_runtime_put();
 
+	r = component_bind_all(&pdev->dev, NULL);
+	if (r)
+		goto err_component;
+
 	dss_debugfs_create_file("dss", dss_dump_regs);
 
 	pm_set_vt_switch(0);
@@ -1167,6 +1173,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_component:
 err_runtime_get:
 	pm_runtime_disable(&pdev->dev);
 	dss_uninit_ports(pdev);
@@ -1182,10 +1189,14 @@ err_setup_clocks:
 	return r;
 }
 
-static int omap_dsshw_remove(struct platform_device *pdev)
+static void dss_unbind(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	dss_initialized = false;
 
+	component_unbind_all(&pdev->dev, NULL);
+
 	if (dss.video1_pll)
 		dss_video_pll_uninit(dss.video1_pll);
 
@@ -1197,7 +1208,46 @@ static int omap_dsshw_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	dss_put_clocks();
+}
+
+static const struct component_master_ops dss_component_ops = {
+	.bind = dss_bind,
+	.unbind = dss_unbind,
+};
 
+static int dss_component_compare(struct device *dev, void *data)
+{
+	struct device *child = data;
+	return dev = child;
+}
+
+static int dss_add_child_component(struct device *dev, void *data)
+{
+	struct component_match **match = data;
+
+	component_match_add(dev->parent, match, dss_component_compare, dev);
+
+	return 0;
+}
+
+static int dss_probe(struct platform_device *pdev)
+{
+	struct component_match *match = NULL;
+	int r;
+
+	/* add all the child devices as components */
+	device_for_each_child(&pdev->dev, &match, dss_add_child_component);
+
+	r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match);
+	if (r)
+		return r;
+
+	return 0;
+}
+
+static int dss_remove(struct platform_device *pdev)
+{
+	component_master_del(&pdev->dev, &dss_component_ops);
 	return 0;
 }
 
@@ -1243,7 +1293,8 @@ static const struct of_device_id dss_of_match[] = {
 MODULE_DEVICE_TABLE(of, dss_of_match);
 
 static struct platform_driver omap_dsshw_driver = {
-	.remove         = omap_dsshw_remove,
+	.probe		= dss_probe,
+	.remove		= dss_remove,
 	.driver         = {
 		.name   = "omapdss_dss",
 		.pm	= &dss_pm_ops,
@@ -1254,7 +1305,7 @@ static struct platform_driver omap_dsshw_driver = {
 
 int __init dss_init_platform_driver(void)
 {
-	return platform_driver_probe(&omap_dsshw_driver, omap_dsshw_probe);
+	return platform_driver_register(&omap_dsshw_driver);
 }
 
 void dss_uninit_platform_driver(void)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 31deebbc32dc..d35312d69025 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -32,6 +32,7 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/component.h>
 #include <video/omapdss.h>
 #include <sound/omap-hdmi-audio.h>
 
@@ -646,8 +647,9 @@ static int hdmi_audio_register(struct device *dev)
 }
 
 /* HDMI HW IP initialisation */
-static int omapdss_hdmihw_probe(struct platform_device *pdev)
+static int hdmi4_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	int r;
 	int irq;
 
@@ -713,8 +715,10 @@ err:
 	return r;
 }
 
-static int omapdss_hdmihw_remove(struct platform_device *pdev)
+static void hdmi4_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	if (hdmi.audio_pdev)
 		platform_device_unregister(hdmi.audio_pdev);
 
@@ -723,7 +727,21 @@ static int omapdss_hdmihw_remove(struct platform_device *pdev)
 	hdmi_pll_uninit(&hdmi.pll);
 
 	pm_runtime_disable(&pdev->dev);
+}
+
+static const struct component_ops hdmi4_component_ops = {
+	.bind	= hdmi4_bind,
+	.unbind	= hdmi4_unbind,
+};
 
+static int hdmi4_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &hdmi4_component_ops);
+}
+
+static int hdmi4_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &hdmi4_component_ops);
 	return 0;
 }
 
@@ -756,8 +774,8 @@ static const struct of_device_id hdmi_of_match[] = {
 };
 
 static struct platform_driver omapdss_hdmihw_driver = {
-	.probe		= omapdss_hdmihw_probe,
-	.remove         = omapdss_hdmihw_remove,
+	.probe		= hdmi4_probe,
+	.remove		= hdmi4_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi",
 		.pm	= &hdmi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index a57f5e8f9aea..7f875788edbc 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -37,6 +37,7 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/component.h>
 #include <video/omapdss.h>
 #include <sound/omap-hdmi-audio.h>
 
@@ -681,8 +682,9 @@ static int hdmi_audio_register(struct device *dev)
 }
 
 /* HDMI HW IP initialisation */
-static int omapdss_hdmihw_probe(struct platform_device *pdev)
+static int hdmi5_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	int r;
 	int irq;
 
@@ -748,8 +750,10 @@ err:
 	return r;
 }
 
-static int omapdss_hdmihw_remove(struct platform_device *pdev)
+static void hdmi5_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	if (hdmi.audio_pdev)
 		platform_device_unregister(hdmi.audio_pdev);
 
@@ -758,7 +762,21 @@ static int omapdss_hdmihw_remove(struct platform_device *pdev)
 	hdmi_pll_uninit(&hdmi.pll);
 
 	pm_runtime_disable(&pdev->dev);
+}
+
+static const struct component_ops hdmi5_component_ops = {
+	.bind	= hdmi5_bind,
+	.unbind	= hdmi5_unbind,
+};
 
+static int hdmi5_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &hdmi5_component_ops);
+}
+
+static int hdmi5_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &hdmi5_component_ops);
 	return 0;
 }
 
@@ -792,8 +810,8 @@ static const struct of_device_id hdmi_of_match[] = {
 };
 
 static struct platform_driver omapdss_hdmihw_driver = {
-	.probe		= omapdss_hdmihw_probe,
-	.remove         = omapdss_hdmihw_remove,
+	.probe		= hdmi5_probe,
+	.remove		= hdmi5_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi5",
 		.pm	= &hdmi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/video/fbdev/omap2/dss/rfbi.c
index 8ec810bce0b6..1525a494d057 100644
--- a/drivers/video/fbdev/omap2/dss/rfbi.c
+++ b/drivers/video/fbdev/omap2/dss/rfbi.c
@@ -36,6 +36,7 @@
 #include <linux/semaphore.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 #include "dss.h"
@@ -946,8 +947,9 @@ static void rfbi_uninit_output(struct platform_device *pdev)
 }
 
 /* RFBI HW IP initialisation */
-static int omap_rfbihw_probe(struct platform_device *pdev)
+static int rfbi_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	u32 rev;
 	struct resource *rfbi_mem;
 	struct clk *clk;
@@ -1005,8 +1007,10 @@ err_runtime_get:
 	return r;
 }
 
-static int omap_rfbihw_remove(struct platform_device *pdev)
+static void rfbi_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	rfbi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
@@ -1014,6 +1018,22 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct component_ops rfbi_component_ops = {
+	.bind	= rfbi_bind,
+	.unbind	= rfbi_unbind,
+};
+
+static int rfbi_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &rfbi_component_ops);
+}
+
+static int rfbi_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &rfbi_component_ops);
+	return 0;
+}
+
 static int rfbi_runtime_suspend(struct device *dev)
 {
 	dispc_runtime_put();
@@ -1038,8 +1058,8 @@ static const struct dev_pm_ops rfbi_pm_ops = {
 };
 
 static struct platform_driver omap_rfbihw_driver = {
-	.probe		= omap_rfbihw_probe,
-	.remove         = omap_rfbihw_remove,
+	.probe		= rfbi_probe,
+	.remove         = rfbi_remove,
 	.driver         = {
 		.name   = "omapdss_rfbi",
 		.pm	= &rfbi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index a873118f1e0e..5843580a1deb 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -27,6 +27,7 @@
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 #include "dss.h"
@@ -357,8 +358,10 @@ static void sdi_uninit_output(struct platform_device *pdev)
 	omapdss_unregister_output(out);
 }
 
-static int omap_sdi_probe(struct platform_device *pdev)
+static int sdi_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	sdi.pdev = pdev;
 
 	sdi_init_output(pdev);
@@ -366,16 +369,32 @@ static int omap_sdi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap_sdi_remove(struct platform_device *pdev)
+static void sdi_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	sdi_uninit_output(pdev);
+}
+
+static const struct component_ops sdi_component_ops = {
+	.bind	= sdi_bind,
+	.unbind	= sdi_unbind,
+};
 
+static int sdi_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &sdi_component_ops);
+}
+
+static int sdi_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &sdi_component_ops);
 	return 0;
 }
 
 static struct platform_driver omap_sdi_driver = {
-	.probe		= omap_sdi_probe,
-	.remove         = omap_sdi_remove,
+	.probe		= sdi_probe,
+	.remove         = sdi_remove,
 	.driver         = {
 		.name   = "omapdss_sdi",
 		.suppress_bind_attrs = true,
diff --git a/drivers/video/fbdev/omap2/dss/venc.c b/drivers/video/fbdev/omap2/dss/venc.c
index e7fad0e19d43..99ca268c1cdd 100644
--- a/drivers/video/fbdev/omap2/dss/venc.c
+++ b/drivers/video/fbdev/omap2/dss/venc.c
@@ -35,6 +35,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 
@@ -852,8 +853,9 @@ err:
 }
 
 /* VENC HW IP initialisation */
-static int omap_venchw_probe(struct platform_device *pdev)
+static int venc_bind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	u8 rev_id;
 	struct resource *venc_mem;
 	int r;
@@ -912,12 +914,28 @@ err_runtime_get:
 	return r;
 }
 
-static int omap_venchw_remove(struct platform_device *pdev)
+static void venc_unbind(struct device *dev, struct device *master, void *data)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+
 	venc_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
+}
 
+static const struct component_ops venc_component_ops = {
+	.bind	= venc_bind,
+	.unbind	= venc_unbind,
+};
+
+static int venc_probe(struct platform_device *pdev)
+{
+	return component_add(&pdev->dev, &venc_component_ops);
+}
+
+static int venc_remove(struct platform_device *pdev)
+{
+	component_del(&pdev->dev, &venc_component_ops);
 	return 0;
 }
 
@@ -950,7 +968,6 @@ static const struct dev_pm_ops venc_pm_ops = {
 	.runtime_resume = venc_runtime_resume,
 };
 
-
 static const struct of_device_id venc_of_match[] = {
 	{ .compatible = "ti,omap2-venc", },
 	{ .compatible = "ti,omap3-venc", },
@@ -959,8 +976,8 @@ static const struct of_device_id venc_of_match[] = {
 };
 
 static struct platform_driver omap_venchw_driver = {
-	.probe		= omap_venchw_probe,
-	.remove         = omap_venchw_remove,
+	.probe		= venc_probe,
+	.remove		= venc_remove,
 	.driver         = {
 		.name   = "omapdss_venc",
 		.pm	= &venc_pm_ops,
-- 
2.1.4


^ permalink raw reply related

* [PATCH 7/7] OMAPDSS: simplify submodule reg/unreg code
From: Tomi Valkeinen @ 2015-06-16 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1434449789-13812-1-git-send-email-tomi.valkeinen@ti.com>

Now that we are using components in omapdss, there's no need for
separate handling of dss and dispc driver init. Thus we can move the dss
and dispc init and unit func pointers to the lists we use for the other
dss submodules.

We can now also handle errors returned by the registration functions
properly: if registering a driver fails, we can stop processing and
return the error.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/core.c | 46 ++++++++++++------------------------
 1 file changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c
index 5c64515de818..54eeb507f9b3 100644
--- a/drivers/video/fbdev/omap2/dss/core.c
+++ b/drivers/video/fbdev/omap2/dss/core.c
@@ -245,6 +245,8 @@ static struct platform_driver omap_dss_driver = {
 
 /* INIT */
 static int (*dss_output_drv_reg_funcs[])(void) __initdata = {
+	dss_init_platform_driver,
+	dispc_init_platform_driver,
 #ifdef CONFIG_OMAP2_DSS_DSI
 	dsi_init_platform_driver,
 #endif
@@ -268,7 +270,7 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = {
 #endif
 };
 
-static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = {
+static void (*dss_output_drv_unreg_funcs[])(void) = {
 #ifdef CONFIG_OMAP5_DSS_HDMI
 	hdmi5_uninit_platform_driver,
 #endif
@@ -290,10 +292,10 @@ static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = {
 #ifdef CONFIG_OMAP2_DSS_DSI
 	dsi_uninit_platform_driver,
 #endif
+	dispc_uninit_platform_driver,
+	dss_uninit_platform_driver,
 };
 
-static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)];
-
 static int __init omap_dss_init(void)
 {
 	int r;
@@ -303,33 +305,20 @@ static int __init omap_dss_init(void)
 	if (r)
 		return r;
 
-	r = dss_init_platform_driver();
-	if (r) {
-		DSSERR("Failed to initialize DSS platform driver\n");
-		goto err_dss;
-	}
-
-	r = dispc_init_platform_driver();
-	if (r) {
-		DSSERR("Failed to initialize dispc platform driver\n");
-		goto err_dispc;
-	}
-
-	/*
-	 * It's ok if the output-driver register fails. It happens, for example,
-	 * when there is no output-device (e.g. SDI for OMAP4).
-	 */
 	for (i = 0; i < ARRAY_SIZE(dss_output_drv_reg_funcs); ++i) {
 		r = dss_output_drv_reg_funcs[i]();
-		if (r = 0)
-			dss_output_drv_loaded[i] = true;
+		if (r)
+			goto err_reg;
 	}
 
 	return 0;
 
-err_dispc:
-	dss_uninit_platform_driver();
-err_dss:
+err_reg:
+	for (i = ARRAY_SIZE(dss_output_drv_reg_funcs) - i;
+			i < ARRAY_SIZE(dss_output_drv_reg_funcs);
+			++i)
+		dss_output_drv_unreg_funcs[i]();
+
 	platform_driver_unregister(&omap_dss_driver);
 
 	return r;
@@ -339,13 +328,8 @@ static void __exit omap_dss_exit(void)
 {
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i) {
-		if (dss_output_drv_loaded[i])
-			dss_output_drv_unreg_funcs[i]();
-	}
-
-	dispc_uninit_platform_driver();
-	dss_uninit_platform_driver();
+	for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i)
+		dss_output_drv_unreg_funcs[i]();
 
 	platform_driver_unregister(&omap_dss_driver);
 }
-- 
2.1.4


^ permalink raw reply related

* [PATCH 1/8] staging: sm7xxfb: declare struct as const
From: Sudip Mukherjee @ 2015-06-16 13:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-fbdev, devel, linux-kernel, Joe Perches, Sudip Mukherjee

The vesa_mode_table is not to be modified, so declare it as const.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/sm7xxfb/sm7xxfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 5db26f1..4d9b69d 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -94,7 +94,7 @@ struct vesa_mode {
 	u16  lfb_depth;
 };
 
-static struct vesa_mode vesa_mode_table[] = {
+static const struct vesa_mode vesa_mode_table[] = {
 	{"0x301", 640,  480,  8},
 	{"0x303", 800,  600,  8},
 	{"0x305", 1024, 768,  8},
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 2/8] staging: sm7xxfb: remove numvgamodes
From: Sudip Mukherjee @ 2015-06-16 13:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-fbdev, devel, linux-kernel, Joe Perches, Sudip Mukherjee
In-Reply-To: <1434462131-15191-1-git-send-email-sudipm.mukherjee@gmail.com>

numvgamodes was only used in one place, so remove the #define
and use its defined value.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/sm7xxfb/sm7xx.h   | 2 --
 drivers/staging/sm7xxfb/sm7xxfb.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h
index c5d6253..4dabda4 100644
--- a/drivers/staging/sm7xxfb/sm7xx.h
+++ b/drivers/staging/sm7xxfb/sm7xx.h
@@ -775,5 +775,3 @@ static struct ModeInit vgamode[] = {
 	  },
 	 },
 };
-
-#define numvgamodes		ARRAY_SIZE(vgamode)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 4d9b69d..5667fbf 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -477,7 +477,7 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
 		"sfb->width=%d sfb->height=%d sfb->fb->var.bits_per_pixel=%d sfb->hz=%d\n",
 		sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz);
 
-	for (j = 0; j < numvgamodes; j++) {
+	for (j = 0; j < ARRAY_SIZE(vgamode); j++) {
 		if (vgamode[j].mmsizex = sfb->width &&
 		    vgamode[j].mmsizey = sfb->height &&
 		    vgamode[j].bpp = sfb->fb->var.bits_per_pixel &&
-- 
1.8.1.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox