lkml.org 
[lkml]   [2009]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 07/12] PCI: Introduce /sys/bus/pci/rescan
On Wed, 18 Mar 2009 16:40:01 -0600 Alex Chiang <achiang@hp.com> wrote:

> +#ifdef CONFIG_HOTPLUG
> +static DEFINE_MUTEX(pci_remove_rescan_mutex);
> +static ssize_t bus_rescan_store(struct bus_type *bus, const char *buf,
> + size_t count)
> +{
> + unsigned long val;
> + struct pci_bus *b = NULL;
> +
> + if (strict_strtoul(buf, 0, &val) < 0)
> + return -EINVAL;
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
> + if (val) {
> + mutex_lock(&pci_remove_rescan_mutex);
> + while ((b = pci_find_next_bus(b)) != NULL)
> + pci_rescan_bus(b);
> + mutex_unlock(&pci_remove_rescan_mutex);
> + }
> + return count;
> +}
> +
> +struct bus_attribute pci_bus_attrs[] = {
> + __ATTR(rescan, S_IWUSR, NULL, bus_rescan_store),
> + __ATTR_NULL
> +};
> +#endif

Why CONFIG_HOTPLUG rather than CONFIG_HOTPLUG_PCI (or similar)?


\
 
 \ /
  Last update: 2009-03-19 10:45    [W:0.190 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site