Commit c6377cee authored by Alessandro Rubini's avatar Alessandro Rubini

kernel: remove dependencies on the SPEC card

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 39fc2a2b
......@@ -17,6 +17,7 @@
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/io.h>
......@@ -24,7 +25,6 @@
#include <linux/fmc.h>
#include <linux/fmc-sdb.h>
#include "spec.h"
#include "fine-delay.h"
#include "hw/fd_main_regs.h"
......
......@@ -23,6 +23,8 @@
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include <linux/fmc.h>
#include "spec.h"
#include "fine-delay.h"
#include "hw/fd_main_regs.h"
......@@ -802,7 +804,6 @@ void fd_zio_unregister(void)
int fd_zio_init(struct fd_dev *fd)
{
int err = 0;
struct spec_dev *spec;
struct pci_dev *pdev;
int dev_id;
......@@ -814,10 +815,20 @@ int fd_zio_init(struct fd_dev *fd)
fd->hwzdev->owner = THIS_MODULE;
fd->hwzdev->private_data = fd;
/* Our dev_id is bus+devfn */
spec = fd->fmc->carrier_data;
pdev = spec->pdev;
dev_id = (pdev->bus->number << 8) | pdev->devfn;
if (!strcmp(fd->fmc->carrier_name, "SPEC")) { /* devid <= bus+devfn */
struct spec_dev *spec;
spec = fd->fmc->carrier_data;
pdev = spec->pdev;
dev_id = (pdev->bus->number << 8) | pdev->devfn;
} else {
/* Please fill this with other carriers. SVEC? */
static int count;
dev_warn(fd->fmc->hwdev, "Unknown FMC carrier \"%s\":"
" using ID %i\n", fd->fmc->carrier_name, count);
dev_id = count++;
}
err = zio_register_device(fd->hwzdev, "fd", dev_id);
if (err) {
......
......@@ -19,7 +19,6 @@
#include <linux/random.h>
#include <linux/firmware.h>
#include <linux/jhash.h>
#include "spec.h"
#include "fine-delay.h"
#include "hw/fd_main_regs.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment