diff options
| author | Rafal Jaworowski <raj@FreeBSD.org> | 2010-07-11 21:08:29 +0000 |
|---|---|---|
| committer | Rafal Jaworowski <raj@FreeBSD.org> | 2010-07-11 21:08:29 +0000 |
| commit | d1d3233ebd5b639265458ec6e2a1f999a805222a (patch) | |
| tree | 827f9dce3768613a609f3a9e594b123936ec2e0e /sys/dev/cfi | |
| parent | c5a514a75699cfed28bd4af58750a5ec18d1c01d (diff) | |
Notes
Diffstat (limited to 'sys/dev/cfi')
| -rw-r--r-- | sys/dev/cfi/cfi_bus_fdt.c (renamed from sys/dev/cfi/cfi_bus_lbc.c) | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/dev/cfi/cfi_bus_lbc.c b/sys/dev/cfi/cfi_bus_fdt.c index df24f389998d..bfbd65f80654 100644 --- a/sys/dev/cfi/cfi_bus_lbc.c +++ b/sys/dev/cfi/cfi_bus_fdt.c @@ -35,49 +35,39 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/conf.h> #include <sys/kernel.h> -#include <sys/malloc.h> #include <sys/module.h> -#include <sys/rman.h> -#include <sys/sysctl.h> #include <machine/bus.h> #include <dev/cfi/cfi_var.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> -#include <powerpc/mpc85xx/lbc.h> +static int cfi_fdt_probe(device_t); -static int cfi_lbc_probe(device_t); - -static device_method_t cfi_lbc_methods[] = { +static device_method_t cfi_fdt_methods[] = { /* device interface */ - DEVMETHOD(device_probe, cfi_lbc_probe), + DEVMETHOD(device_probe, cfi_fdt_probe), DEVMETHOD(device_attach, cfi_attach), DEVMETHOD(device_detach, cfi_detach), {0, 0} }; -static driver_t cfi_lbc_driver = { +static driver_t cfi_fdt_driver = { cfi_driver_name, - cfi_lbc_methods, + cfi_fdt_methods, sizeof(struct cfi_softc), }; -DRIVER_MODULE (cfi, lbc, cfi_lbc_driver, cfi_devclass, 0, 0); +DRIVER_MODULE (cfi, lbc, cfi_fdt_driver, cfi_devclass, 0, 0); static int -cfi_lbc_probe(device_t dev) +cfi_fdt_probe(device_t dev) { - uintptr_t devtype; - int error; - - error = BUS_READ_IVAR(device_get_parent(dev), dev, LBC_IVAR_DEVTYPE, - &devtype); - if (error) - return (error); - if (devtype != LBC_DEVTYPE_CFI) - return (EINVAL); + if (!ofw_bus_is_compatible(dev, "cfi-flash")) + return (ENXIO); return (cfi_probe(dev)); } |
