linux/drivers/pnp
Heiner Kallweit e0f03e87fc PNP: respect PNP_DRIVER_RES_DO_NOT_CHANGE when detaching
I have a device (Nuvoton 6779D Super-IO IR RC with nuvoton-cir driver)
which works after initial boot but not any longer if I unload and
re-load the driver module.

Digging into the issue I found that unloading the driver calls
pnp_disable_dev although the driver has flag PNP_DRIVER_RES_DO_NOT_CHANGE
set. IMHO this is not right.

Let's have a look at the call chain when probing a device:
pnp_device_probe
1. attaches the device
2. if it's not active and PNP_DRIVER_RES_DO_NOT_CHANGE is not set
   it gets activated
3. probes driver

I think pnp_device_remove should do it in reverse order and also
respect PNP_DRIVER_RES_DO_NOT_CHANGE. Therefore:
1. call drivers remove callback
2. if device is active and PNP_DRIVER_RES_DO_NOT_CHANGE is not set
   disable it
3. detach device

The change works for me and sounds logical to me.
However I don't know the pnp driver in detail so I might be wrong.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-01-04 22:12:42 +01:00
..
isapnp isapnp: switch to fixed_size_llseek() 2013-06-29 12:57:48 +04:00
pnpacpi ACPI / scan: constify struct acpi_hardware_id::id 2015-09-15 02:57:55 +02:00
pnpbios pnpbios: bail out on strange errors 2015-01-25 09:17:59 -08:00
Kconfig PNP: remove old CONFIG_PNP_DEBUG option 2008-10-10 23:35:33 -04:00
Makefile PNP: Compile all pnp built-in stuff in one module namespace 2010-10-27 02:23:44 -04:00
base.h PNP: Convert pnp_lock into a mutex 2015-03-18 22:39:55 +01:00
card.c PNP: Convert pnp_lock into a mutex 2015-03-18 22:39:55 +01:00
core.c PNP: Avoid leaving unregistered device objects in lists 2015-03-18 22:40:04 +01:00
driver.c PNP: respect PNP_DRIVER_RES_DO_NOT_CHANGE when detaching 2016-01-04 22:12:42 +01:00
interface.c PNP: replace strnicmp with strncasecmp 2014-10-14 02:18:25 +02:00
manager.c cleanup IORESOURCE_CACHEABLE vs ioremap() 2015-08-10 23:07:06 -04:00
quirks.c PNP: Add Broadwell to Intel MCH size workaround 2016-01-03 01:16:53 +01:00
resource.c PNP: Switch from __check_region() to __request_region() 2015-01-22 01:14:50 +01:00
support.c PNPACPI: add bus number support 2010-03-14 20:08:38 -04:00
system.c ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage 2015-07-06 23:52:21 +02:00