2005-10-26 20:55:08

by Laurent Riffard

[permalink] [raw]
Subject: [RFC patch 2/3] remove pci_driver.owner and .name fields

Use pci_driver.driver.name instead of pci_driver.name (this field is
planned for deletion).

This patch updates the drivers found in directory drivers/block.

Signed-off-by: Laurent Riffard <[email protected]>
--

drivers/block/DAC960.c | 4 +++-
drivers/block/cciss.c | 4 +++-
drivers/block/cpqarray.c | 4 +++-
drivers/block/sx8.c | 4 +++-
drivers/block/umem.c | 4 +++-
5 files changed, 15 insertions(+), 5 deletions(-)

Index: linux-2.6-stable/drivers/block/DAC960.c
===================================================================
--- linux-2.6-stable.orig/drivers/block/DAC960.c
+++ linux-2.6-stable/drivers/block/DAC960.c
@@ -7185,7 +7185,9 @@
MODULE_DEVICE_TABLE(pci, DAC960_id_table);

static struct pci_driver DAC960_pci_driver = {
- .name = "DAC960",
+ .driver = {
+ .name = "DAC960",
+ },
.id_table = DAC960_id_table,
.probe = DAC960_Probe,
.remove = DAC960_Remove,
Index: linux-2.6-stable/drivers/block/cciss.c
===================================================================
--- linux-2.6-stable.orig/drivers/block/cciss.c
+++ linux-2.6-stable/drivers/block/cciss.c
@@ -2929,7 +2929,9 @@
}

static struct pci_driver cciss_pci_driver = {
- .name = "cciss",
+ .driver = {
+ .name = "cciss",
+ },
.probe = cciss_init_one,
.remove = __devexit_p(cciss_remove_one),
.id_table = cciss_pci_device_id, /* id_table */
Index: linux-2.6-stable/drivers/block/cpqarray.c
===================================================================
--- linux-2.6-stable.orig/drivers/block/cpqarray.c
+++ linux-2.6-stable/drivers/block/cpqarray.c
@@ -541,7 +541,9 @@
}

static struct pci_driver cpqarray_pci_driver = {
- .name = "cpqarray",
+ .driver = {
+ .name = "cpqarray",
+ },
.probe = cpqarray_init_one,
.remove = __devexit_p(cpqarray_remove_one_pci),
.id_table = cpqarray_pci_device_id,
Index: linux-2.6-stable/drivers/block/sx8.c
===================================================================
--- linux-2.6-stable.orig/drivers/block/sx8.c
+++ linux-2.6-stable/drivers/block/sx8.c
@@ -395,7 +395,9 @@
MODULE_DEVICE_TABLE(pci, carm_pci_tbl);

static struct pci_driver carm_driver = {
- .name = DRV_NAME,
+ .driver = {
+ .name = DRV_NAME,
+ },
.id_table = carm_pci_tbl,
.probe = carm_init_one,
.remove = carm_remove_one,
Index: linux-2.6-stable/drivers/block/umem.c
===================================================================
--- linux-2.6-stable.orig/drivers/block/umem.c
+++ linux-2.6-stable/drivers/block/umem.c
@@ -1170,7 +1170,9 @@
MODULE_DEVICE_TABLE(pci, mm_pci_ids);

static struct pci_driver mm_pci_driver = {
- .name = "umem",
+ .driver = {
+ .name = "umem",
+ },
.id_table = mm_pci_ids,
.probe = mm_pci_probe,
.remove = mm_pci_remove,

--


2005-10-26 21:05:19

by Roland Dreier

[permalink] [raw]
Subject: Re: [RFC patch 2/3] remove pci_driver.owner and .name fields

> - .name = "DAC960",
> + .driver = {
> + .name = "DAC960",
> + },

This change looks like a (rather ugly) step backwards. Maybe it would
be better to add the name as a parameter to pci_register_driver?

- R.

2005-10-26 21:21:29

by Al Viro

[permalink] [raw]
Subject: Re: [RFC patch 2/3] remove pci_driver.owner and .name fields

On Wed, Oct 26, 2005 at 02:05:08PM -0700, Roland Dreier wrote:
> > - .name = "DAC960",
> > + .driver = {
> > + .name = "DAC960",
> > + },
>
> This change looks like a (rather ugly) step backwards. Maybe it would
> be better to add the name as a parameter to pci_register_driver?

It looks stupid in the first place - what's wrong with
.driver.name = "DAC960",
instead of that mess?

2005-10-26 21:31:08

by Roland Dreier

[permalink] [raw]
Subject: Re: [RFC patch 2/3] remove pci_driver.owner and .name fields

> It looks stupid in the first place - what's wrong with
> .driver.name = "DAC960",
> instead of that mess?

Unfortunately I don't think gcc 2.95 accepts that syntax. For
example the following:

void foo(void)
{
struct {
struct {
int y;
} x;
} bar = {
.x.y = 1
};
}

gives

a.c: In function `foo':
a.c:8: unknown field `y' specified in initializer

when compiled with gcc 2.95.

I guess we could do

.driver = { .name = "DAC960" },

but that seems silly as well.

- R.

2005-10-26 21:35:17

by Andrew Morton

[permalink] [raw]
Subject: Re: [RFC patch 2/3] remove pci_driver.owner and .name fields

Al Viro <[email protected]> wrote:
>
> On Wed, Oct 26, 2005 at 02:05:08PM -0700, Roland Dreier wrote:
> > > - .name = "DAC960",
> > > + .driver = {
> > > + .name = "DAC960",
> > > + },
> >
> > This change looks like a (rather ugly) step backwards. Maybe it would
> > be better to add the name as a parameter to pci_register_driver?
>
> It looks stupid in the first place - what's wrong with
> .driver.name = "DAC960",
> instead of that mess?

gcc-2.95.x doesn't support that.