diff mbox

[BUGFIX,3/9] ACPI, DOCK: clean up unused module related code

Message ID 1371141152-9468-4-git-send-email-jiang.liu@huawei.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Jiang Liu June 13, 2013, 4:32 p.m. UTC
ACPI dock driver can't be built as a module any more, so clean up
module related code.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/acpi/dock.c | 41 -----------------------------------------
 1 file changed, 41 deletions(-)

Comments

Rafael Wysocki June 13, 2013, 6:26 p.m. UTC | #1
On Friday, June 14, 2013 12:32:26 AM Jiang Liu wrote:
> ACPI dock driver can't be built as a module any more, so clean up
> module related code.
> 
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Cc: Shaohua Li <shaohua.li@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: linux-acpi@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org

How exactly does this depend on [2/9]?  If it doesn't at all, it should go
after [1/9].

> ---
>  drivers/acpi/dock.c | 41 -----------------------------------------
>  1 file changed, 41 deletions(-)
> 
> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> index 79c8d9e..50e38b7 100644
> --- a/drivers/acpi/dock.c
> +++ b/drivers/acpi/dock.c
> @@ -53,12 +53,6 @@ MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
>  
>  static struct atomic_notifier_head dock_notifier_list;
>  
> -static const struct acpi_device_id dock_device_ids[] = {
> -	{"LNXDOCK", 0},
> -	{"", 0},
> -};
> -MODULE_DEVICE_TABLE(acpi, dock_device_ids);
> -

Don't we actually need the device IDs?

>  struct dock_station {
>  	acpi_handle handle;
>  	unsigned long last_dock_time;
> @@ -1013,30 +1007,6 @@ err_unregister:
>  }
>  
>  /**
> - * dock_remove - free up resources related to the dock station
> - */
> -static int dock_remove(struct dock_station *ds)
> -{
> -	struct dock_dependent_device *dd, *tmp;
> -	struct platform_device *dock_device = ds->dock_device;
> -
> -	if (!dock_station_count)
> -		return 0;
> -
> -	/* remove dependent devices */
> -	list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
> -		kfree(dd);
> -
> -	list_del(&ds->sibling);
> -
> -	/* cleanup sysfs */
> -	sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
> -	platform_device_unregister(dock_device);
> -
> -	return 0;
> -}
> -
> -/**
>   * find_dock_and_bay - look for dock stations and bays
>   * @handle: acpi handle of a device
>   * @lvl: unused
> @@ -1073,14 +1043,3 @@ int __init acpi_dock_init(void)
>  		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
>  	return 0;
>  }
> -
> -static void __exit dock_exit(void)
> -{
> -	struct dock_station *tmp, *dock_station;
> -
> -	unregister_acpi_bus_notifier(&dock_acpi_notifier);
> -	list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
> -		dock_remove(dock_station);
> -}
> -
> -module_exit(dock_exit);

The other changes look OK to me.

Thanks,
Rafael
Rafael Wysocki June 13, 2013, 6:39 p.m. UTC | #2
On Thursday, June 13, 2013 08:26:10 PM Rafael J. Wysocki wrote:
> On Friday, June 14, 2013 12:32:26 AM Jiang Liu wrote:
> > ACPI dock driver can't be built as a module any more, so clean up
> > module related code.
> > 
> > Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> > Cc: Shaohua Li <shaohua.li@intel.com>
> > Cc: Len Brown <lenb@kernel.org>
> > Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> > Cc: linux-acpi@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> 
> How exactly does this depend on [2/9]?  If it doesn't at all, it should go
> after [1/9].

However, this isn't even 3.10 material, so please stop sending it for now.

Thanks,
Rafael


> > ---
> >  drivers/acpi/dock.c | 41 -----------------------------------------
> >  1 file changed, 41 deletions(-)
> > 
> > diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> > index 79c8d9e..50e38b7 100644
> > --- a/drivers/acpi/dock.c
> > +++ b/drivers/acpi/dock.c
> > @@ -53,12 +53,6 @@ MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
> >  
> >  static struct atomic_notifier_head dock_notifier_list;
> >  
> > -static const struct acpi_device_id dock_device_ids[] = {
> > -	{"LNXDOCK", 0},
> > -	{"", 0},
> > -};
> > -MODULE_DEVICE_TABLE(acpi, dock_device_ids);
> > -
> 
> Don't we actually need the device IDs?
> 
> >  struct dock_station {
> >  	acpi_handle handle;
> >  	unsigned long last_dock_time;
> > @@ -1013,30 +1007,6 @@ err_unregister:
> >  }
> >  
> >  /**
> > - * dock_remove - free up resources related to the dock station
> > - */
> > -static int dock_remove(struct dock_station *ds)
> > -{
> > -	struct dock_dependent_device *dd, *tmp;
> > -	struct platform_device *dock_device = ds->dock_device;
> > -
> > -	if (!dock_station_count)
> > -		return 0;
> > -
> > -	/* remove dependent devices */
> > -	list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
> > -		kfree(dd);
> > -
> > -	list_del(&ds->sibling);
> > -
> > -	/* cleanup sysfs */
> > -	sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
> > -	platform_device_unregister(dock_device);
> > -
> > -	return 0;
> > -}
> > -
> > -/**
> >   * find_dock_and_bay - look for dock stations and bays
> >   * @handle: acpi handle of a device
> >   * @lvl: unused
> > @@ -1073,14 +1043,3 @@ int __init acpi_dock_init(void)
> >  		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
> >  	return 0;
> >  }
> > -
> > -static void __exit dock_exit(void)
> > -{
> > -	struct dock_station *tmp, *dock_station;
> > -
> > -	unregister_acpi_bus_notifier(&dock_acpi_notifier);
> > -	list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
> > -		dock_remove(dock_station);
> > -}
> > -
> > -module_exit(dock_exit);
> 
> The other changes look OK to me.
Jiang Liu June 14, 2013, 2:04 p.m. UTC | #3
On 06/14/2013 02:26 AM, Rafael J. Wysocki wrote:
> On Friday, June 14, 2013 12:32:26 AM Jiang Liu wrote:
>> ACPI dock driver can't be built as a module any more, so clean up
>> module related code.
>>
>> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
>> Cc: Shaohua Li <shaohua.li@intel.com>
>> Cc: Len Brown <lenb@kernel.org>
>> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
>> Cc: linux-acpi@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
> 
> How exactly does this depend on [2/9]?  If it doesn't at all, it should go
> after [1/9].
> 
>> ---
>>  drivers/acpi/dock.c | 41 -----------------------------------------
>>  1 file changed, 41 deletions(-)
>>
>> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
>> index 79c8d9e..50e38b7 100644
>> --- a/drivers/acpi/dock.c
>> +++ b/drivers/acpi/dock.c
>> @@ -53,12 +53,6 @@ MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
>>  
>>  static struct atomic_notifier_head dock_notifier_list;
>>  
>> -static const struct acpi_device_id dock_device_ids[] = {
>> -	{"LNXDOCK", 0},
>> -	{"", 0},
>> -};
>> -MODULE_DEVICE_TABLE(acpi, dock_device_ids);
>> -
> 
> Don't we actually need the device IDs?
Now dock driver could only be built as built-in, and it doesn't really
bind to ACPI dock devices, so I think the device ids are not used any
more. Not sure whether any userspace tool has dependency on the device
IDs.

> 
>>  struct dock_station {
>>  	acpi_handle handle;
>>  	unsigned long last_dock_time;
>> @@ -1013,30 +1007,6 @@ err_unregister:
>>  }
>>  
>>  /**
>> - * dock_remove - free up resources related to the dock station
>> - */
>> -static int dock_remove(struct dock_station *ds)
>> -{
>> -	struct dock_dependent_device *dd, *tmp;
>> -	struct platform_device *dock_device = ds->dock_device;
>> -
>> -	if (!dock_station_count)
>> -		return 0;
>> -
>> -	/* remove dependent devices */
>> -	list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
>> -		kfree(dd);
>> -
>> -	list_del(&ds->sibling);
>> -
>> -	/* cleanup sysfs */
>> -	sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
>> -	platform_device_unregister(dock_device);
>> -
>> -	return 0;
>> -}
>> -
>> -/**
>>   * find_dock_and_bay - look for dock stations and bays
>>   * @handle: acpi handle of a device
>>   * @lvl: unused
>> @@ -1073,14 +1043,3 @@ int __init acpi_dock_init(void)
>>  		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
>>  	return 0;
>>  }
>> -
>> -static void __exit dock_exit(void)
>> -{
>> -	struct dock_station *tmp, *dock_station;
>> -
>> -	unregister_acpi_bus_notifier(&dock_acpi_notifier);
>> -	list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
>> -		dock_remove(dock_station);
>> -}
>> -
>> -module_exit(dock_exit);
> 
> The other changes look OK to me.
Thanks for review.

> 
> Thanks,
> Rafael
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael Wysocki June 14, 2013, 2:16 p.m. UTC | #4
On Friday, June 14, 2013 10:04:01 PM Jiang Liu wrote:
> On 06/14/2013 02:26 AM, Rafael J. Wysocki wrote:
> > On Friday, June 14, 2013 12:32:26 AM Jiang Liu wrote:
> >> ACPI dock driver can't be built as a module any more, so clean up
> >> module related code.
> >>
> >> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> >> Cc: Shaohua Li <shaohua.li@intel.com>
> >> Cc: Len Brown <lenb@kernel.org>
> >> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> >> Cc: linux-acpi@vger.kernel.org
> >> Cc: linux-kernel@vger.kernel.org
> > 
> > How exactly does this depend on [2/9]?  If it doesn't at all, it should go
> > after [1/9].
> > 
> >> ---
> >>  drivers/acpi/dock.c | 41 -----------------------------------------
> >>  1 file changed, 41 deletions(-)
> >>
> >> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> >> index 79c8d9e..50e38b7 100644
> >> --- a/drivers/acpi/dock.c
> >> +++ b/drivers/acpi/dock.c
> >> @@ -53,12 +53,6 @@ MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
> >>  
> >>  static struct atomic_notifier_head dock_notifier_list;
> >>  
> >> -static const struct acpi_device_id dock_device_ids[] = {
> >> -	{"LNXDOCK", 0},
> >> -	{"", 0},
> >> -};
> >> -MODULE_DEVICE_TABLE(acpi, dock_device_ids);
> >> -
> > 
> > Don't we actually need the device IDs?
> Now dock driver could only be built as built-in, and it doesn't really
> bind to ACPI dock devices, so I think the device ids are not used any
> more. Not sure whether any userspace tool has dependency on the device
> IDs.

I see.  OK

Thanks,
Rafael


> > 
> >>  struct dock_station {
> >>  	acpi_handle handle;
> >>  	unsigned long last_dock_time;
> >> @@ -1013,30 +1007,6 @@ err_unregister:
> >>  }
> >>  
> >>  /**
> >> - * dock_remove - free up resources related to the dock station
> >> - */
> >> -static int dock_remove(struct dock_station *ds)
> >> -{
> >> -	struct dock_dependent_device *dd, *tmp;
> >> -	struct platform_device *dock_device = ds->dock_device;
> >> -
> >> -	if (!dock_station_count)
> >> -		return 0;
> >> -
> >> -	/* remove dependent devices */
> >> -	list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
> >> -		kfree(dd);
> >> -
> >> -	list_del(&ds->sibling);
> >> -
> >> -	/* cleanup sysfs */
> >> -	sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
> >> -	platform_device_unregister(dock_device);
> >> -
> >> -	return 0;
> >> -}
> >> -
> >> -/**
> >>   * find_dock_and_bay - look for dock stations and bays
> >>   * @handle: acpi handle of a device
> >>   * @lvl: unused
> >> @@ -1073,14 +1043,3 @@ int __init acpi_dock_init(void)
> >>  		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
> >>  	return 0;
> >>  }
> >> -
> >> -static void __exit dock_exit(void)
> >> -{
> >> -	struct dock_station *tmp, *dock_station;
> >> -
> >> -	unregister_acpi_bus_notifier(&dock_acpi_notifier);
> >> -	list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
> >> -		dock_remove(dock_station);
> >> -}
> >> -
> >> -module_exit(dock_exit);
> > 
> > The other changes look OK to me.
> Thanks for review.
> 
> > 
> > Thanks,
> > Rafael
> > 
> > 
>
diff mbox

Patch

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 79c8d9e..50e38b7 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -53,12 +53,6 @@  MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
 
 static struct atomic_notifier_head dock_notifier_list;
 
-static const struct acpi_device_id dock_device_ids[] = {
-	{"LNXDOCK", 0},
-	{"", 0},
-};
-MODULE_DEVICE_TABLE(acpi, dock_device_ids);
-
 struct dock_station {
 	acpi_handle handle;
 	unsigned long last_dock_time;
@@ -1013,30 +1007,6 @@  err_unregister:
 }
 
 /**
- * dock_remove - free up resources related to the dock station
- */
-static int dock_remove(struct dock_station *ds)
-{
-	struct dock_dependent_device *dd, *tmp;
-	struct platform_device *dock_device = ds->dock_device;
-
-	if (!dock_station_count)
-		return 0;
-
-	/* remove dependent devices */
-	list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
-		kfree(dd);
-
-	list_del(&ds->sibling);
-
-	/* cleanup sysfs */
-	sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
-	platform_device_unregister(dock_device);
-
-	return 0;
-}
-
-/**
  * find_dock_and_bay - look for dock stations and bays
  * @handle: acpi handle of a device
  * @lvl: unused
@@ -1073,14 +1043,3 @@  int __init acpi_dock_init(void)
 		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
 	return 0;
 }
-
-static void __exit dock_exit(void)
-{
-	struct dock_station *tmp, *dock_station;
-
-	unregister_acpi_bus_notifier(&dock_acpi_notifier);
-	list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
-		dock_remove(dock_station);
-}
-
-module_exit(dock_exit);