Messages in this thread | | | From | Rolf Eike Beer <> | Subject | Re: [PATCH] pci: Allow read/write access to I/O port resources | Date | Mon, 19 Jul 2010 07:56:30 +0200 |
| |
Alex Williamson wrote: > PCI sysfs resource files currently only allow mmap'ing, which doesn't > work on all architectures, particularly x86. Add read/write to > allow access to these device regions using sysfs.
I think you should update that description a bit. It took me some time to find out you are not talking about mmap() on PCI resource files in general, but those that are backed by I/O BARs. The other ones work fine on x86 with mmap().
> +static ssize_t > +pci_resource_io(struct file *filp, struct kobject *kobj, > + struct bin_attribute *attr, char *buf, > + loff_t off, size_t count, int write) > +{
The "write" can be bool.
> + struct pci_dev *pdev = to_pci_dev(container_of(kobj, > + struct device, kobj)); > + struct resource *res = (struct resource *)attr->private;
No need to cast here, private is void* anyway.
Eike [unhandled content-type:application/pgp-signature] | |