14 #include <linux/kernel.h>
15 #include <linux/module.h>
17 #include <linux/pci.h>
21 #include <linux/slab.h>
26 #define DRV_NAME "janz-cmodio"
29 #define CMODIO_MODULBUS_SIZE 0x200
32 #define CMODIO_MAX_MODULES 4
37 "empty",
"empty",
"empty",
"empty",
44 static unsigned int cmodio_id;
85 cell->
id = cmodio_id++;
126 unsigned int num_probed = 0;
130 for (i = 0; i < num_modules; i++) {
135 dev_dbg(&priv->
pdev->dev,
"MODULbus %d: name %s\n", i, name);
136 cmodio_setup_subdevice(priv, name, num_probed, i);
141 if (num_probed == 0) {
142 dev_err(&priv->
pdev->dev,
"no MODULbus modules specified, "
143 "please set the ``modules'' kernel "
144 "parameter according to your "
145 "hardware configuration\n");
167 static struct attribute *cmodio_sysfs_attrs[] = {
168 &dev_attr_modulbus_number.attr,
173 .attrs = cmodio_sysfs_attrs,
188 dev_err(&dev->
dev,
"unable to allocate private data\n");
193 pci_set_drvdata(dev, priv);
199 dev_err(&dev->
dev,
"unable to enable device\n");
206 dev_err(&dev->
dev,
"unable to request regions\n");
207 goto out_pci_disable_device;
213 dev_err(&dev->
dev,
"unable to remap onboard regs\n");
215 goto out_pci_release_regions;
224 dev_err(&dev->
dev,
"unable to create sysfs attributes\n");
235 ret = cmodio_probe_submodules(priv);
237 dev_err(&dev->
dev,
"unable to probe submodules\n");
238 goto out_sysfs_remove_group;
243 out_sysfs_remove_group:
247 out_pci_release_regions:
249 out_pci_disable_device:
269 #define PCI_VENDOR_ID_JANZ 0x13c3
279 static struct pci_driver cmodio_pci_driver = {
281 .id_table = cmodio_pci_ids,
282 .probe = cmodio_pci_probe,