All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity
@ 2011-12-13 14:02 Laurent Pinchart
  2011-12-15 16:16 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to Guennadi Liakhovetski
  2011-12-16  9:52 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart
  0 siblings, 2 replies; 3+ messages in thread
From: Laurent Pinchart @ 2011-12-13 14:02 UTC (permalink / raw)
  To: linux-fbdev

The field will be used by the transmitter drivers to access
sh_mobile_lcdc_chan fields such as fb_info.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/sh_mobile_lcdcfb.c |    5 ++++-
 drivers/video/sh_mobile_lcdcfb.h |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index cb5ea3c..2dccfde 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1497,8 +1497,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
 		if (!info || !info->device)
 			continue;
 
-		if (ch->tx_dev)
+		if (ch->tx_dev) {
+			ch->tx_dev->lcdc = NULL;
 			module_put(ch->cfg.tx_dev->dev.driver->owner);
+		}
 
 		if (ch->sglist)
 			vfree(ch->sglist);
@@ -1608,6 +1610,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
 			return -EINVAL;
 		}
 		ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
+		ch->tx_dev->lcdc = ch;
 	}
 
 	/* Iterate through the modes to validate them and find the highest
diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
index 9601b92..36cd564 100644
--- a/drivers/video/sh_mobile_lcdcfb.h
+++ b/drivers/video/sh_mobile_lcdcfb.h
@@ -19,6 +19,7 @@ struct fb_info;
 struct module;
 struct sh_mobile_lcdc_entity;
 struct sh_mobile_lcdc_priv;
+struct sh_mobile_lcdc_chan;
 
 struct sh_mobile_lcdc_entity_ops {
 	/* Display */
@@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
 struct sh_mobile_lcdc_entity {
 	struct module *owner;
 	const struct sh_mobile_lcdc_entity_ops *ops;
+	struct sh_mobile_lcdc_chan *lcdc;
 };
 
 /*
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to
  2011-12-13 14:02 [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart
@ 2011-12-15 16:16 ` Guennadi Liakhovetski
  2011-12-16  9:52 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2011-12-15 16:16 UTC (permalink / raw)
  To: linux-fbdev

Hi Laurent

On Tue, 13 Dec 2011, Laurent Pinchart wrote:

> The field will be used by the transmitter drivers to access
> sh_mobile_lcdc_chan fields such as fb_info.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/video/sh_mobile_lcdcfb.c |    5 ++++-
>  drivers/video/sh_mobile_lcdcfb.h |    2 ++
>  2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index cb5ea3c..2dccfde 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -1497,8 +1497,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
>  		if (!info || !info->device)
>  			continue;
>  
> -		if (ch->tx_dev)
> +		if (ch->tx_dev) {
> +			ch->tx_dev->lcdc = NULL;
>  			module_put(ch->cfg.tx_dev->dev.driver->owner);
> +		}
>  
>  		if (ch->sglist)
>  			vfree(ch->sglist);
> @@ -1608,6 +1610,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
>  			return -EINVAL;
>  		}
>  		ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
> +		ch->tx_dev->lcdc = ch;

I do not have a kernel, patched with your patches up to 20/57;-) so, I 
cannot verify - can ch->tx_dev at this point not be NULL?

>  	}
>  
>  	/* Iterate through the modes to validate them and find the highest
> diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
> index 9601b92..36cd564 100644
> --- a/drivers/video/sh_mobile_lcdcfb.h
> +++ b/drivers/video/sh_mobile_lcdcfb.h
> @@ -19,6 +19,7 @@ struct fb_info;
>  struct module;
>  struct sh_mobile_lcdc_entity;
>  struct sh_mobile_lcdc_priv;
> +struct sh_mobile_lcdc_chan;
>  
>  struct sh_mobile_lcdc_entity_ops {
>  	/* Display */
> @@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
>  struct sh_mobile_lcdc_entity {
>  	struct module *owner;
>  	const struct sh_mobile_lcdc_entity_ops *ops;
> +	struct sh_mobile_lcdc_chan *lcdc;
>  };
>  
>  /*
> -- 
> 1.7.3.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity
  2011-12-13 14:02 [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart
  2011-12-15 16:16 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to Guennadi Liakhovetski
@ 2011-12-16  9:52 ` Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2011-12-16  9:52 UTC (permalink / raw)
  To: linux-fbdev

Hi Guennadi,

On Thursday 15 December 2011 17:16:16 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > The field will be used by the transmitter drivers to access
> > sh_mobile_lcdc_chan fields such as fb_info.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> >  drivers/video/sh_mobile_lcdcfb.c |    5 ++++-
> >  drivers/video/sh_mobile_lcdcfb.h |    2 ++
> >  2 files changed, 6 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index cb5ea3c..2dccfde 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c
> > @@ -1497,8 +1497,10 @@ static int sh_mobile_lcdc_remove(struct
> > platform_device *pdev)
> > 
> >  		if (!info || !info->device)
> >  		
> >  			continue;
> > 
> > -		if (ch->tx_dev)
> > +		if (ch->tx_dev) {
> > +			ch->tx_dev->lcdc = NULL;
> > 
> >  			module_put(ch->cfg.tx_dev->dev.driver->owner);
> > 
> > +		}
> > 
> >  		if (ch->sglist)
> >  		
> >  			vfree(ch->sglist);
> > 
> > @@ -1608,6 +1610,7 @@ sh_mobile_lcdc_channel_init(struct
> > sh_mobile_lcdc_priv *priv,
> > 
> >  			return -EINVAL;
> >  		
> >  		}
> >  		ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
> > 
> > +		ch->tx_dev->lcdc = ch;
> 
> I do not have a kernel, patched with your patches up to 20/57;-) so, I
> cannot verify - can ch->tx_dev at this point not be NULL?

I don't think so, as the

        if (!cfg->tx_dev->dev.driver ||
            !try_module_get(cfg->tx_dev->dev.driver->owner))

check above ensures that the transmitter driver is loaded and bound to the 
device. As the transmitter driver calls platform_Set_drvdata() at probe time, 
platform_get_drvdata() will not return NULL.


> >  	}
> >  	
> >  	/* Iterate through the modes to validate them and find the highest
> > 
> > diff --git a/drivers/video/sh_mobile_lcdcfb.h
> > b/drivers/video/sh_mobile_lcdcfb.h index 9601b92..36cd564 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.h
> > +++ b/drivers/video/sh_mobile_lcdcfb.h
> > @@ -19,6 +19,7 @@ struct fb_info;
> > 
> >  struct module;
> >  struct sh_mobile_lcdc_entity;
> >  struct sh_mobile_lcdc_priv;
> > 
> > +struct sh_mobile_lcdc_chan;
> > 
> >  struct sh_mobile_lcdc_entity_ops {
> >  
> >  	/* Display */
> > 
> > @@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
> > 
> >  struct sh_mobile_lcdc_entity {
> >  
> >  	struct module *owner;
> >  	const struct sh_mobile_lcdc_entity_ops *ops;
> > 
> > +	struct sh_mobile_lcdc_chan *lcdc;
> > 
> >  };
> >  
> >  /*

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-16  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 14:02 [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart
2011-12-15 16:16 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to Guennadi Liakhovetski
2011-12-16  9:52 ` [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.