2011-02-24 09:33:36

by Marek Belisko

[permalink] [raw]
Subject: [PATCH] staging: gma500: Fix compilation error.

This patch will fix following compilation error:
drivers/staging/gma500/psb_drv.c:1635: error: unknown field ‘pci_driver’ specified in initializer
drivers/staging/gma500/psb_drv.c:1636: error: unknown field ‘name’ specified in initializer
drivers/staging/gma500/psb_drv.c:1636: warning: initialization from incompatible pointer type
drivers/staging/gma500/psb_drv.c:1637: error: unknown field ‘id_table’ specified in initializer
drivers/staging/gma500/psb_drv.c:1637: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1637: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c:1638: error: unknown field ‘resume’ specified in initializer
drivers/staging/gma500/psb_drv.c:1638: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1638: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c:1639: error: unknown field ‘suspend’ specified in initializer
drivers/staging/gma500/psb_drv.c:1639: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1639: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c:1640: error: unknown field ‘probe’ specified in initializer
drivers/staging/gma500/psb_drv.c:1640: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1640: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c:1641: error: unknown field ‘remove’ specified in initializer
drivers/staging/gma500/psb_drv.c:1641: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1641: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c:1643: error: unknown field ‘driver’ specified in initializer
drivers/staging/gma500/psb_drv.c:1643: warning: excess elements in union initializer
drivers/staging/gma500/psb_drv.c:1643: warning: (near initialization for ‘driver.kdriver’)
drivers/staging/gma500/psb_drv.c: In function ‘psb_init’:
drivers/staging/gma500/psb_drv.c:1664: error: implicit declaration of function ‘drm_init’
drivers/staging/gma500/psb_drv.c: In function ‘psb_exit’:
drivers/staging/gma500/psb_drv.c:1669: error: implicit declaration of function ‘drm_exit’

Signed-off-by: Marek Belisko <[email protected]>
---
drivers/staging/gma500/psb_drv.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/gma500/psb_drv.c b/drivers/staging/gma500/psb_drv.c
index 2fe09c8..caa5140 100644
--- a/drivers/staging/gma500/psb_drv.c
+++ b/drivers/staging/gma500/psb_drv.c
@@ -1632,17 +1632,6 @@ static struct drm_driver driver = {
.fasync = drm_fasync,
.read = drm_read,
},
- .pci_driver = {
- .name = DRIVER_NAME,
- .id_table = pciidlist,
- .resume = ospm_power_resume,
- .suspend = ospm_power_suspend,
- .probe = psb_probe,
- .remove = psb_remove,
-#ifdef CONFIG_PM
- .driver.pm = &psb_pm_ops,
-#endif
- },
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.date = PSB_DRM_DRIVER_DATE,
@@ -1651,6 +1640,18 @@ static struct drm_driver driver = {
.patchlevel = PSB_DRM_DRIVER_PATCHLEVEL
};

+static struct pci_driver psb_pci_driver = {
+ .name = DRIVER_NAME,
+ .id_table = pciidlist,
+ .resume = ospm_power_resume,
+ .suspend = ospm_power_suspend,
+ .probe = psb_probe,
+ .remove = psb_remove,
+#ifdef CONFIG_PM
+ .driver.pm = &psb_pm_ops,
+#endif
+};
+
static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
/* MLD Added this from Inaky's patch */
@@ -1661,12 +1662,12 @@ static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

static int __init psb_init(void)
{
- return drm_init(&driver);
+ return drm_pci_init(&driver, &psb_pci_driver);
}

static void __exit psb_exit(void)
{
- drm_exit(&driver);
+ drm_pci_exit(&driver, &psb_pci_driver);
}

late_initcall(psb_init);
--
1.7.1


2011-02-24 12:49:40

by Alan

[permalink] [raw]
Subject: Re: [PATCH] staging: gma500: Fix compilation error.

On Thu, 24 Feb 2011 10:33:18 +0100
Marek Belisko <[email protected]> wrote:

> This patch will fix following compilation error:

The joys of the DRM layer API of the week.

Acked-by: Alan Cox <[email protected]>

2011-02-24 17:13:06

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] staging: gma500: Fix compilation error.

On Thu, Feb 24, 2011 at 10:33:18AM +0100, Marek Belisko wrote:
> This patch will fix following compilation error:
> drivers/staging/gma500/psb_drv.c:1635: error: unknown field ‘pci_driver’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1636: error: unknown field ‘name’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1636: warning: initialization from incompatible pointer type
> drivers/staging/gma500/psb_drv.c:1637: error: unknown field ‘id_table’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1637: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1637: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c:1638: error: unknown field ‘resume’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1638: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1638: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c:1639: error: unknown field ‘suspend’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1639: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1639: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c:1640: error: unknown field ‘probe’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1640: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1640: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c:1641: error: unknown field ‘remove’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1641: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1641: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c:1643: error: unknown field ‘driver’ specified in initializer
> drivers/staging/gma500/psb_drv.c:1643: warning: excess elements in union initializer
> drivers/staging/gma500/psb_drv.c:1643: warning: (near initialization for ‘driver.kdriver’)
> drivers/staging/gma500/psb_drv.c: In function ‘psb_init’:
> drivers/staging/gma500/psb_drv.c:1664: error: implicit declaration of function ‘drm_init’
> drivers/staging/gma500/psb_drv.c: In function ‘psb_exit’:
> drivers/staging/gma500/psb_drv.c:1669: error: implicit declaration of function ‘drm_exit’
>
> Signed-off-by: Marek Belisko <[email protected]>

Odd, how come I'm not hitting these in the staging-next tree? Is it
because an api changed in the DRM layer in the linux-next tree?

thanks,

greg k-h

2011-02-24 19:59:21

by Belisko Marek

[permalink] [raw]
Subject: Re: [PATCH] staging: gma500: Fix compilation error.

Hi Greg,

On Thu, Feb 24, 2011 at 6:12 PM, Greg KH <[email protected]> wrote:
> On Thu, Feb 24, 2011 at 10:33:18AM +0100, Marek Belisko wrote:
>> This patch will fix following compilation error:
>> drivers/staging/gma500/psb_drv.c:1635: error: unknown field ‘pci_driver’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1636: error: unknown field ‘name’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1636: warning: initialization from incompatible pointer type
>> drivers/staging/gma500/psb_drv.c:1637: error: unknown field ‘id_table’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1637: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1637: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c:1638: error: unknown field ‘resume’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1638: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1638: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c:1639: error: unknown field ‘suspend’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1639: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1639: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c:1640: error: unknown field ‘probe’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1640: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1640: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c:1641: error: unknown field ‘remove’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1641: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1641: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c:1643: error: unknown field ‘driver’ specified in initializer
>> drivers/staging/gma500/psb_drv.c:1643: warning: excess elements in union initializer
>> drivers/staging/gma500/psb_drv.c:1643: warning: (near initialization for ‘driver.kdriver’)
>> drivers/staging/gma500/psb_drv.c: In function ‘psb_init’:
>> drivers/staging/gma500/psb_drv.c:1664: error: implicit declaration of function ‘drm_init’
>> drivers/staging/gma500/psb_drv.c: In function ‘psb_exit’:
>> drivers/staging/gma500/psb_drv.c:1669: error: implicit declaration of function ‘drm_exit’
>>
>> Signed-off-by: Marek Belisko <[email protected]>
>
> Odd, how come I'm not hitting these in the staging-next tree?  Is it
> because an api changed in the DRM layer in the linux-next tree?
Yes DRM api was changed:
commit 8410ea3b95d105a5be5db501656f44bbb91197c1
Author: Dave Airlie <[email protected]>
Date: Wed Dec 15 03:16:38 2010 +1000

drm: rework PCI/platform driver interface.

Introduce union kdriver which encapsulate pci_driver struct.
That's cause of error in gma500.
>
> thanks,
>
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

thanks,

marek

--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

2011-02-25 00:46:12

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] staging: gma500: Fix compilation error.

On Thu, Feb 24, 2011 at 08:58:52PM +0100, Belisko Marek wrote:
> Hi Greg,
>
> On Thu, Feb 24, 2011 at 6:12 PM, Greg KH <[email protected]> wrote:
> > On Thu, Feb 24, 2011 at 10:33:18AM +0100, Marek Belisko wrote:
> >> This patch will fix following compilation error:
> >> drivers/staging/gma500/psb_drv.c:1635: error: unknown field ‘pci_driver’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1636: error: unknown field ‘name’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1636: warning: initialization from incompatible pointer type
> >> drivers/staging/gma500/psb_drv.c:1637: error: unknown field ‘id_table’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1637: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1637: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c:1638: error: unknown field ‘resume’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1638: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1638: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c:1639: error: unknown field ‘suspend’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1639: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1639: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c:1640: error: unknown field ‘probe’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1640: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1640: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c:1641: error: unknown field ‘remove’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1641: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1641: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c:1643: error: unknown field ‘driver’ specified in initializer
> >> drivers/staging/gma500/psb_drv.c:1643: warning: excess elements in union initializer
> >> drivers/staging/gma500/psb_drv.c:1643: warning: (near initialization for ‘driver.kdriver’)
> >> drivers/staging/gma500/psb_drv.c: In function ‘psb_init’:
> >> drivers/staging/gma500/psb_drv.c:1664: error: implicit declaration of function ‘drm_init’
> >> drivers/staging/gma500/psb_drv.c: In function ‘psb_exit’:
> >> drivers/staging/gma500/psb_drv.c:1669: error: implicit declaration of function ‘drm_exit’
> >>
> >> Signed-off-by: Marek Belisko <[email protected]>
> >
> > Odd, how come I'm not hitting these in the staging-next tree?  Is it
> > because an api changed in the DRM layer in the linux-next tree?
> Yes DRM api was changed:
> commit 8410ea3b95d105a5be5db501656f44bbb91197c1
> Author: Dave Airlie <[email protected]>
> Date: Wed Dec 15 03:16:38 2010 +1000
>
> drm: rework PCI/platform driver interface.
>
> Introduce union kdriver which encapsulate pci_driver struct.
> That's cause of error in gma500.

Ok, this is going to get messy then, this patch should be held by
Stephen in linux-next until we merge stuff with Linus, and then I'll be
able to apply it to my tree. So I'll just save it in my queue until
that time happens, thanks.

greg k-h