i2c_intel_mid: Fix slash in sysfs name
PATCH 1/1 i2c_intel_mid: Fix slash in sysfs name
From: Alan Cox <alan-VuQAYsv1563Yd54FQh9/[email protected]>
This gets caught by the new sanity check code. Instead of the slash use a different symbol. This was originally found by Major Lee who proposed a rather more complex patch which changed the name according to the chip type.
On the basis that we are in a late -rc and making Linus grumpy isn't always a good idea (however fun) this is a simple alternative.
---
drivers/i2c/busses/i2c-intel-mid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-intel-mid.c +1 -1
@@ -1035,7 +1035,7 @@ static int __devinit intel_mid_i2c_probe(struct pci_dev *dev,/* Initialize struct members */ snprintf (mrst->adap.name,sizeof (mrst->adap.name), -"MRST/Medfield I2C at %lx" , start); +"Intel MID I2C at %lx" , start); mrst->adap.owner =THIS_MODULE ; mrst->adap.algo = &intel_mid_i2c_algorithm; mrst->adap.dev.parent = &dev->dev;
A message that is not in the archive (sent off-list or not yet received): 20101214152849.7265.93628.stgit-Z/[email protected]
Hi Alan,
Quoted 3 lines · Alan Cox
From: Alan Cox <alan-VuQAYsv1563Yd54FQh9/[email protected]>
This gets caught by the new sanity check code.
New sanity check of what? Where's the code?
Quoted 20 lines
Instead of the slash use a
different symbol. This was originally found by Major Lee who proposed a rather more complex patch which changed the name according to the chip type.On the basis that we are in a late -rc and making Linus grumpy isn't always a good idea (however fun) this is a simple alternative.
Signed-off-by Alan Cox <alan-VuQAYsv1563Yd54FQh9/[email protected]>---
drivers/i2c/busses/i2c-intel-mid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-intel-mid.c +0
-0
drivers/i2c/busses/i2c-intel-mid.c static int __devinit intel_mid_i2c_probe(struct pci_dev *dev, · line 1041
Quoted 8 lines
drivers/i2c/busses/i2c-intel-mid.c +1
-1@@ -1035,7 +1035,7 @@ static int __devinit intel_mid_i2c_probe(struct pci_dev *dev,/* Initialize struct members */ snprintf (mrst->adap.name,sizeof (mrst->adap.name), -"MRST/Medfield I2C at %lx" , start); +"Intel MID I2C at %lx" , start); mrst->adap.owner =THIS_MODULE ; mrst->adap.algo = &intel_mid_i2c_algorithm; mrst->adap.dev.parent = &dev->dev;
Having a slash in an I2C adapter name shouldn't be a problem. The real problem is below:
err = request_irq(dev->irq, intel_mid_i2c_isr, IRQF_SHARED, mrst->adap.name, mrst);
Using the adapter name to request the IRQ is silly. The very same issue was fixed in i2c-pca-platform recently:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=323584436db0cb05286425d4dfd9516fce88487f
You want to use a short name for the interrupt. Either the driver name, or if you really want something device-specific, the bus device name.
Signature · 1 line
Jean Delvare
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 41 lines · Jean Delvare
Hi Alan,
Quoted 3 lines · Alan Cox
From: Alan Cox <alan-VuQAYsv1563Yd54FQh9/[email protected]>
This gets caught by the new sanity check code.
New sanity check of what? Where's the code?
Quoted 20 lines
Instead of the slash use a
different symbol. This was originally found by Major Lee who proposed a rather more complex patch which changed the name according to the chip type.On the basis that we are in a late -rc and making Linus grumpy isn't always a good idea (however fun) this is a simple alternative.
Signed-off-by Alan Cox <alan-VuQAYsv1563Yd54FQh9/[email protected]>---
drivers/i2c/busses/i2c-intel-mid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-intel-mid.c +0
-0drivers/i2c/busses/i2c-intel-mid.c static int __devinit intel_mid_i2c_probe(struct pci_dev *dev, · line 1041
Quoted 8 lines
drivers/i2c/busses/i2c-intel-mid.c +1
-1@@ -1035,7 +1035,7 @@ static int __devinit intel_mid_i2c_probe(struct pci_dev *dev,/* Initialize struct members */ snprintf (mrst->adap.name,sizeof (mrst->adap.name), -"MRST/Medfield I2C at %lx" , start); +"Intel MID I2C at %lx" , start); mrst->adap.owner =THIS_MODULE ; mrst->adap.algo = &intel_mid_i2c_algorithm; mrst->adap.dev.parent = &dev->dev;Having a slash in an I2C adapter name shouldn't be a problem. The real problem is below:
Quoted 6 lines
err = request_irq(dev->irq, intel_mid_i2c_isr, IRQF_SHARED, mrst->adap.name, mrst);Using the adapter name to request the IRQ is silly. The very same issue was fixed in i2c-pca-platform recently:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=323584436db0cb05286425d4dfd9516fce88487f
I agree, something like dev_name(dev) is much better for readability of /proc/interruopts
Quoted 3 lines
You want to use a short name for the interrupt. Either the driver name, or if you really want something device-specific, the bus device name.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line
Quoted 1 line
New sanity check of what? Where's the code?
Slashes in path names - it was added to the sysfs code
Quoted 6 lines
Quoted 3 lines
Using the adapter name to request the IRQ is silly. The very same issue was fixed in i2c-pca-platform recently:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=323584436db0cb05286425d4dfd9516fce88487fI agree, something like
dev_name(dev)is much better for readability of/proc/interruopts
I'll take a look at this now I am back from Christmas break.
Alan