2013-05-16 07:11:12

by Lad, Prabhakar

[permalink] [raw]
Subject: [PATCH 0/2] video: da8xx-fb trival cleanup

From: Lad, Prabhakar <[email protected]>

This patch series cleans the header inclusion and uses devm_* api
in the driver.

This patch series applies on 3.10-rc1 and is only boot
tested enabling FB driver.

Lad, Prabhakar (2):
video: da8xx-fb: remove unwanted header inclusion and sort the
alphabetically
video:da8xx-fb: Convert to devm_* api

drivers/video/da8xx-fb.c | 62 ++++++++++++---------------------------------
1 files changed, 17 insertions(+), 45 deletions(-)

--
1.7.4.1


2013-05-16 07:11:20

by Lad, Prabhakar

[permalink] [raw]
Subject: [PATCH 1/2] video: da8xx-fb: remove unwanted header inclusion and sort the alphabetically

From: Lad, Prabhakar <[email protected]>

This patch removes unwanted header inclusion and sorts them alphabetically

Signed-off-by: Lad, Prabhakar <[email protected]>
---
drivers/video/da8xx-fb.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 0810939..aafe8b9 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -19,25 +19,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/fb.h>
+
+#include <linux/clk.h>
+#include <linux/console.h>
+#include <linux/cpufreq.h>
#include <linux/dma-mapping.h>
-#include <linux/device.h>
+#include <linux/fb.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-#include <linux/clk.h>
-#include <linux/cpufreq.h>
-#include <linux/console.h>
-#include <linux/spinlock.h>
-#include <linux/slab.h>
+#include <linux/uaccess.h>
+
#include <linux/delay.h>
#include <linux/lcm.h>
+
#include <video/da8xx-fb.h>
-#include <asm/div64.h>

#define DRIVER_NAME "da8xx_lcdc"

--
1.7.4.1

2013-05-16 07:11:26

by Lad, Prabhakar

[permalink] [raw]
Subject: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

From: Lad, Prabhakar <[email protected]>

Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
devm_request_irq() instead of request_irq().

This ensures more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar <[email protected]>
---
drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
1 files changed, 7 insertions(+), 32 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index aafe8b9..d35ea1d 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -134,7 +134,6 @@
#define LOWER_MARGIN 32

static void __iomem *da8xx_fb_reg_base;
-static struct resource *lcdc_regs;
static unsigned int lcd_revision;
static irq_handler_t lcdc_irq_handler;
static wait_queue_head_t frame_done_wq;
@@ -1015,12 +1014,9 @@ static int fb_remove(struct platform_device *dev)
par->p_palette_base);
dma_free_coherent(NULL, par->vram_size, par->vram_virt,
par->vram_phys);
- free_irq(par->irq, par);
pm_runtime_put_sync(&dev->dev);
pm_runtime_disable(&dev->dev);
framebuffer_release(info);
- iounmap(da8xx_fb_reg_base);
- release_mem_region(lcdc_regs->start, resource_size(lcdc_regs));

}
return 0;
@@ -1212,12 +1208,12 @@ static int fb_probe(struct platform_device *device)
{
struct da8xx_lcdc_platform_data *fb_pdata =
device->dev.platform_data;
+ static struct resource *lcdc_regs;
struct lcd_ctrl_config *lcd_cfg;
struct fb_videomode *lcdc_info;
struct fb_info *da8xx_fb_info;
struct clk *fb_clk = NULL;
struct da8xx_fb_par *par;
- resource_size_t len;
int ret, i;
unsigned long ulcm;

@@ -1227,29 +1223,14 @@ static int fb_probe(struct platform_device *device)
}

lcdc_regs = platform_get_resource(device, IORESOURCE_MEM, 0);
- if (!lcdc_regs) {
- dev_err(&device->dev,
- "Can not get memory resource for LCD controller\n");
- return -ENOENT;
- }
-
- len = resource_size(lcdc_regs);
-
- lcdc_regs = request_mem_region(lcdc_regs->start, len, lcdc_regs->name);
- if (!lcdc_regs)
- return -EBUSY;
-
- da8xx_fb_reg_base = ioremap(lcdc_regs->start, len);
- if (!da8xx_fb_reg_base) {
- ret = -EBUSY;
- goto err_request_mem;
- }
+ da8xx_fb_reg_base = devm_ioremap_resource(&device->dev, lcdc_regs);
+ if (IS_ERR(da8xx_fb_reg_base))
+ return PTR_ERR(da8xx_fb_reg_base);

fb_clk = clk_get(&device->dev, "fck");
if (IS_ERR(fb_clk)) {
dev_err(&device->dev, "Can not get device clock\n");
- ret = -ENODEV;
- goto err_ioremap;
+ return -ENODEV;
}

pm_runtime_enable(&device->dev);
@@ -1430,8 +1411,8 @@ static int fb_probe(struct platform_device *device)
lcdc_irq_handler = lcdc_irq_handler_rev02;
}

- ret = request_irq(par->irq, lcdc_irq_handler, 0,
- DRIVER_NAME, par);
+ ret = devm_request_irq(&device->dev, par->irq, lcdc_irq_handler, 0,
+ DRIVER_NAME, par);
if (ret)
goto irq_freq;
return 0;
@@ -1460,12 +1441,6 @@ err_pm_runtime_disable:
pm_runtime_put_sync(&device->dev);
pm_runtime_disable(&device->dev);

-err_ioremap:
- iounmap(da8xx_fb_reg_base);
-
-err_request_mem:
- release_mem_region(lcdc_regs->start, len);
-
return ret;
}

--
1.7.4.1

2013-06-26 11:20:24

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

Hi Tomi/ Florian

On Thu, May 16, 2013 at 12:40 PM, Lad Prabhakar
<[email protected]> wrote:
> From: Lad, Prabhakar <[email protected]>
>
> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
> devm_request_irq() instead of request_irq().
>
> This ensures more consistent error values and simplifies error paths.
>
> Signed-off-by: Lad, Prabhakar <[email protected]>
> ---

Can you pick up this patch and drop 1/2.

Regards,
--Prabhakar Lad

2013-06-26 11:39:56

by Tomi Valkeinen

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

On 16/05/13 10:10, Lad Prabhakar wrote:
> From: Lad, Prabhakar <[email protected]>
>
> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
> devm_request_irq() instead of request_irq().
>
> This ensures more consistent error values and simplifies error paths.
>
> Signed-off-by: Lad, Prabhakar <[email protected]>
> ---
> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
> 1 files changed, 7 insertions(+), 32 deletions(-)

There's something similar in Darren's da8xx-fb series. Can you check if
there are differences?

Tomi



Attachments:
signature.asc (901.00 B)
OpenPGP digital signature

2013-06-26 11:57:15

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

Hi Tomi,

On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <[email protected]> wrote:
> On 16/05/13 10:10, Lad Prabhakar wrote:
>> From: Lad, Prabhakar <[email protected]>
>>
>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>> devm_request_irq() instead of request_irq().
>>
>> This ensures more consistent error values and simplifies error paths.
>>
>> Signed-off-by: Lad, Prabhakar <[email protected]>
>> ---
>> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
>> 1 files changed, 7 insertions(+), 32 deletions(-)
>
> There's something similar in Darren's da8xx-fb series. Can you check if
> there are differences?
>
I don't see similar changes in his patch series.

Darren while you are at it you can take this patch along you series.
let me know how you plan to.

Regards,
--Prabhakar Lad

2013-06-26 12:00:43

by Tomi Valkeinen

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

On 26/06/13 14:56, Prabhakar Lad wrote:
> Hi Tomi,
>
> On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <[email protected]> wrote:
>> On 16/05/13 10:10, Lad Prabhakar wrote:
>>> From: Lad, Prabhakar <[email protected]>
>>>
>>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>>> devm_request_irq() instead of request_irq().
>>>
>>> This ensures more consistent error values and simplifies error paths.
>>>
>>> Signed-off-by: Lad, Prabhakar <[email protected]>
>>> ---
>>> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
>>> 1 files changed, 7 insertions(+), 32 deletions(-)
>>
>> There's something similar in Darren's da8xx-fb series. Can you check if
>> there are differences?
>>
> I don't see similar changes in his patch series.

[PATCH 14/23] video: da8xx-fb: use devres

Tomi



Attachments:
signature.asc (901.00 B)
OpenPGP digital signature

2013-06-26 12:07:19

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

Hi Tomi,

On Wed, Jun 26, 2013 at 5:30 PM, Tomi Valkeinen <[email protected]> wrote:
> On 26/06/13 14:56, Prabhakar Lad wrote:
>> Hi Tomi,
>>
>> On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <[email protected]> wrote:
>>> On 16/05/13 10:10, Lad Prabhakar wrote:
>>>> From: Lad, Prabhakar <[email protected]>
>>>>
>>>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>>>> devm_request_irq() instead of request_irq().
>>>>
>>>> This ensures more consistent error values and simplifies error paths.
>>>>
>>>> Signed-off-by: Lad, Prabhakar <[email protected]>
>>>> ---
>>>> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
>>>> 1 files changed, 7 insertions(+), 32 deletions(-)
>>>
>>> There's something similar in Darren's da8xx-fb series. Can you check if
>>> there are differences?
>>>
>> I don't see similar changes in his patch series.
>
> [PATCH 14/23] video: da8xx-fb: use devres
>
Oops missed it out :), patch is almost similar except
for following block,

- fb_clk = clk_get(&device->dev, "fck");
+ fb_clk = devm_clk_get(&device->dev, "fck");
if (IS_ERR(fb_clk)) {
dev_err(&device->dev, "Can not get device clock\n");
- ret = -ENODEV;
- goto err_ioremap;
+ return -ENODEV;
}

How do you suggest to handle it ?

Regards,
--Prabhakar Lad

2013-06-26 12:11:24

by Tomi Valkeinen

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

On 26/06/13 15:06, Prabhakar Lad wrote:
> Hi Tomi,
>
> On Wed, Jun 26, 2013 at 5:30 PM, Tomi Valkeinen <[email protected]> wrote:
>> On 26/06/13 14:56, Prabhakar Lad wrote:
>>> Hi Tomi,
>>>
>>> On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <[email protected]> wrote:
>>>> On 16/05/13 10:10, Lad Prabhakar wrote:
>>>>> From: Lad, Prabhakar <[email protected]>
>>>>>
>>>>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>>>>> devm_request_irq() instead of request_irq().
>>>>>
>>>>> This ensures more consistent error values and simplifies error paths.
>>>>>
>>>>> Signed-off-by: Lad, Prabhakar <[email protected]>
>>>>> ---
>>>>> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
>>>>> 1 files changed, 7 insertions(+), 32 deletions(-)
>>>>
>>>> There's something similar in Darren's da8xx-fb series. Can you check if
>>>> there are differences?
>>>>
>>> I don't see similar changes in his patch series.
>>
>> [PATCH 14/23] video: da8xx-fb: use devres
>>
> Oops missed it out :), patch is almost similar except
> for following block,
>
> - fb_clk = clk_get(&device->dev, "fck");
> + fb_clk = devm_clk_get(&device->dev, "fck");
> if (IS_ERR(fb_clk)) {
> dev_err(&device->dev, "Can not get device clock\n");
> - ret = -ENODEV;
> - goto err_ioremap;
> + return -ENODEV;
> }
>
> How do you suggest to handle it ?

I think it's easiest if Darren handles the da8xx-fb series for 3.11. So
if there's something missing from Darren's series, please discuss with him.

Tomi



Attachments:
signature.asc (901.00 B)
OpenPGP digital signature

2013-07-02 09:16:20

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

Hi Darren,

On Wed, Jun 26, 2013 at 5:41 PM, Tomi Valkeinen <[email protected]> wrote:
> On 26/06/13 15:06, Prabhakar Lad wrote:
>> Hi Tomi,
>>
>> On Wed, Jun 26, 2013 at 5:30 PM, Tomi Valkeinen <[email protected]> wrote:
>>> On 26/06/13 14:56, Prabhakar Lad wrote:
>>>> Hi Tomi,
>>>>
>>>> On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <[email protected]> wrote:
>>>>> On 16/05/13 10:10, Lad Prabhakar wrote:
>>>>>> From: Lad, Prabhakar <[email protected]>
>>>>>>
>>>>>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>>>>>> devm_request_irq() instead of request_irq().
>>>>>>
>>>>>> This ensures more consistent error values and simplifies error paths.
>>>>>>
>>>>>> Signed-off-by: Lad, Prabhakar <[email protected]>
>>>>>> ---
>>>>>> drivers/video/da8xx-fb.c | 39 +++++++--------------------------------
>>>>>> 1 files changed, 7 insertions(+), 32 deletions(-)
>>>>>
>>>>> There's something similar in Darren's da8xx-fb series. Can you check if
>>>>> there are differences?
>>>>>
>>>> I don't see similar changes in his patch series.
>>>
>>> [PATCH 14/23] video: da8xx-fb: use devres
>>>
>> Oops missed it out :), patch is almost similar except
>> for following block,
>>
>> - fb_clk = clk_get(&device->dev, "fck");
>> + fb_clk = devm_clk_get(&device->dev, "fck");
>> if (IS_ERR(fb_clk)) {
>> dev_err(&device->dev, "Can not get device clock\n");
>> - ret = -ENODEV;
>> - goto err_ioremap;
>> + return -ENODEV;
>> }
>>
>> How do you suggest to handle it ?
>
> I think it's easiest if Darren handles the da8xx-fb series for 3.11. So
> if there's something missing from Darren's series, please discuss with him.
>
Either you merge this patch with yours or rebase your patch on top of my patch.
Let me know how you would like to handle it ?

Regards,
--Prabhakar Lad

2013-07-02 22:31:11

by Etheridge, Darren

[permalink] [raw]
Subject: RE: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api

> >> How do you suggest to handle it ?
> >
> > I think it's easiest if Darren handles the da8xx-fb series for 3.11.
> > So if there's something missing from Darren's series, please discuss
> with him.
> >
> Either you merge this patch with yours or rebase your patch on top of
> my patch.
> Let me know how you would like to handle it ?
Prabhakar,

I will include your change with the next version of this patch series that will address Tomi's review comments.

Darren