[PATCH 1/2] mfd/janz-cmodio: fix MODULBus number sysfs entry

From: Ira W. Snyder
Date: Tue Sep 11 2012 - 18:58:34 EST

From: "Ira W. Snyder" <iws@xxxxxxxxxxxxxxxx>

Revision 1.0 of the Janz CMOD-IO Carrier Board does not contain zeroes
in the top 4 bits of the modulbus_num (int_enable) register. Mask off
the unused bits so that the correct value is displayed in sysfs.

Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
Signed-off-by: Ira W. Snyder <iws@xxxxxxxxxxxxxxxx>
drivers/mfd/janz-cmodio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index 2ea9998..32d0efd 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -216,7 +216,7 @@ static int __devinit cmodio_pci_probe(struct pci_dev *dev,

/* Read the hex switch on the carrier board */
- priv->hex = ioread8(&priv->ctrl->int_enable);
+ priv->hex = ioread8(&priv->ctrl->int_enable) & 0x0f;

/* Add the MODULbus number (hex switch value) to the device's sysfs */
ret = sysfs_create_group(&dev->dev.kobj, &cmodio_sysfs_attr_group);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/