Zorro sysfs/driver model
Geert Uytterhoeven
maintainerPATCH 1/1 Zorro sysfs/driver model
Zorro bus: Add support for sysfs and the new driver model
drivers/zorro/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Zorro bus specific drivers. # -obj-$(CONFIG_ZORRO) += zorro.o names.o +obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o obj-$(CONFIG_PROC_FS) += proc.o host-progs := gen-devlist
drivers/zorro/proc.c +10 -11
@@ -3,7 +3,7 @@* * Procfs interface for the Zorro bus. * -* Copyright (C) 1998-2000 Geert Uytterhoeven +* Copyright (C) 1998-2003 Geert Uytterhoeven * * Heavily based on the procfs interface for the PCI bus, which is *
@@ -49,7 +49,7 @@ {struct inode *ino = file->f_dentry->d_inode;struct proc_dir_entry *dp =PDE (ino); -struct zorro_dev *dev = dp->data; +struct zorro_dev *z = dp->data;struct ConfigDev cd;loff_t pos = *ppos;
@@ -62,11 +62,11 @@/* Construct a ConfigDev */ memset (&cd,0 ,sizeof (cd)); - cd.cd_Rom = dev->rom; - cd.cd_SlotAddr = dev->slotaddr; - cd.cd_SlotSize = dev->slotsize; - cd.cd_BoardAddr = (void *)dev->resource.start; - cd.cd_BoardSize = dev->resource.end-dev->resource.start+1 ; + cd.cd_Rom = z->rom; + cd.cd_SlotAddr = z->slotaddr; + cd.cd_SlotSize = z->slotsize; + cd.cd_BoardAddr = (void *)zorro_resource_start (z); + cd.cd_BoardSize =zorro_resource_len (z);if (copy_to_user (buf, &cd, nbytes))return -EFAULT ;
@@ -88,11 +88,10 @@int len, cnt;for (slot = cnt =0 ; slot < zorro_num_autocon && count > cnt; slot++) { -struct zorro_dev *dev = &zorro_autocon[slot]; +struct zorro_dev *z = &zorro_autocon[slot]; len =sprintf (buf,"%02x\t%08x\t%08lx\t%08lx\t%02x\n" , slot, - dev->id, dev->resource.start, - dev->resource.end-dev->resource.start+1 , - dev->rom.er_Type); + z->id,zorro_resource_start (z), +zorro_resource_len (z), z->rom.er_Type); at += len;if (at >= pos) {if (!*start) {
drivers/zorro/zorro.c +54 -41
154 lines not on this page · raw message
include/linux/zorro.h +132 -15
194 lines not on this page · raw message
drivers/zorro/zorro-driver.c +150 -0
150 lines not on this page · raw message
drivers/zorro/zorro-sysfs.c +97 -0
97 lines not on this page · raw message
drivers/zorro/zorro.h +4 -0
@@ -0,0 +1,4 @@ + +extern void zorro_name_device (struct zorro_dev *z); +extern void zorro_create_sysfs_dev_files (struct zorro_dev *z); +
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds