[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201007190756.38412.eike-kernel@sf-tec.de>
Date: Mon, 19 Jul 2010 07:56:30 +0200
From: Rolf Eike Beer <eike-kernel@...tec.de>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
chrisw@...hat.com, ddutile@...hat.com, bjorn.helgaas@...com
Subject: Re: [PATCH] pci: Allow read/write access to I/O port resources
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
Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists