All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Aaron Lu <aaron.lu@intel.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	Lan Tianyu <tianyu.lan@intel.com>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 4/4] ACPI / PM: Drop two functions that are not used any more
Date: Tue, 18 Jun 2013 15:00:28 +0200	[thread overview]
Message-ID: <2356401.FiBQpSHJGJ@vostro.rjw.lan> (raw)
In-Reply-To: <51C02664.2050603@intel.com>

On Tuesday, June 18, 2013 05:20:36 PM Aaron Lu wrote:
> On 06/14/2013 08:33 PM, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Two functions defined in device_pm.c, acpi_dev_pm_add_dependent()
> > and acpi_dev_pm_remove_dependent(), have no callers and may be
> > dropped, so drop them.
> 
> Please hold on for a moment, I would like to discuss the ATA ACPI
> binding with you and Tejun, the current binding with SCSI device tree
> doesn't buy us anything but introduced some nasty consequences. I think
> we should bind ACPI handle with ATA port/device, I have a draft patch
> for this and will send out soon. If we go binding with ATA port/device,
> then the two functions will be needed :-)

OK, this change can wait.  I'll drop [4/4] for now.

Thanks,
Rafael


> > Moreover, they are the only functions adding entries to and removing
> > entries from the power_dependent list in struct acpi_device, so drop
> > that list and the loop walking it in acpi_power_resume_dependent()
> > too.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/acpi/device_pm.c |   56 -----------------------------------------------
> >  drivers/acpi/power.c     |    3 --
> >  drivers/acpi/scan.c      |    1 
> >  include/acpi/acpi_bus.h  |    7 -----
> >  4 files changed, 67 deletions(-)
> > 
> > Index: linux-pm/include/acpi/acpi_bus.h
> > ===================================================================
> > --- linux-pm.orig/include/acpi/acpi_bus.h
> > +++ linux-pm/include/acpi/acpi_bus.h
> > @@ -308,7 +308,6 @@ struct acpi_device {
> >  	struct list_head physical_node_list;
> >  	struct mutex physical_node_lock;
> >  	DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE);
> > -	struct list_head power_dependent;
> >  	void (*remove)(struct acpi_device *);
> >  };
> >  
> > @@ -461,8 +460,6 @@ acpi_status acpi_add_pm_notifier(struct
> >  acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
> >  				    acpi_notify_handler handler);
> >  int acpi_pm_device_sleep_state(struct device *, int *, int);
> > -void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
> > -void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
> >  #else
> >  static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
> >  					       acpi_notify_handler handler,
> > @@ -482,10 +479,6 @@ static inline int acpi_pm_device_sleep_s
> >  
> >  	return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
> >  }
> > -static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
> > -					     struct device *depdev) {}
> > -static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
> > -						struct device *depdev) {}
> >  #endif
> >  
> >  #ifdef CONFIG_PM_RUNTIME
> > Index: linux-pm/drivers/acpi/device_pm.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/device_pm.c
> > +++ linux-pm/drivers/acpi/device_pm.c
> > @@ -994,60 +994,4 @@ void acpi_dev_pm_detach(struct device *d
> >  	}
> >  }
> >  EXPORT_SYMBOL_GPL(acpi_dev_pm_detach);
> > -
> > -/**
> > - * acpi_dev_pm_add_dependent - Add physical device depending for PM.
> > - * @handle: Handle of ACPI device node.
> > - * @depdev: Device depending on that node for PM.
> > - */
> > -void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev)
> > -{
> > -	struct acpi_device_physical_node *dep;
> > -	struct acpi_device *adev;
> > -
> > -	if (!depdev || acpi_bus_get_device(handle, &adev))
> > -		return;
> > -
> > -	mutex_lock(&adev->physical_node_lock);
> > -
> > -	list_for_each_entry(dep, &adev->power_dependent, node)
> > -		if (dep->dev == depdev)
> > -			goto out;
> > -
> > -	dep = kzalloc(sizeof(*dep), GFP_KERNEL);
> > -	if (dep) {
> > -		dep->dev = depdev;
> > -		list_add_tail(&dep->node, &adev->power_dependent);
> > -	}
> > -
> > - out:
> > -	mutex_unlock(&adev->physical_node_lock);
> > -}
> > -EXPORT_SYMBOL_GPL(acpi_dev_pm_add_dependent);
> > -
> > -/**
> > - * acpi_dev_pm_remove_dependent - Remove physical device depending for PM.
> > - * @handle: Handle of ACPI device node.
> > - * @depdev: Device depending on that node for PM.
> > - */
> > -void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev)
> > -{
> > -	struct acpi_device_physical_node *dep;
> > -	struct acpi_device *adev;
> > -
> > -	if (!depdev || acpi_bus_get_device(handle, &adev))
> > -		return;
> > -
> > -	mutex_lock(&adev->physical_node_lock);
> > -
> > -	list_for_each_entry(dep, &adev->power_dependent, node)
> > -		if (dep->dev == depdev) {
> > -			list_del(&dep->node);
> > -			kfree(dep);
> > -			break;
> > -		}
> > -
> > -	mutex_unlock(&adev->physical_node_lock);
> > -}
> > -EXPORT_SYMBOL_GPL(acpi_dev_pm_remove_dependent);
> >  #endif /* CONFIG_PM */
> > Index: linux-pm/drivers/acpi/power.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/power.c
> > +++ linux-pm/drivers/acpi/power.c
> > @@ -253,9 +253,6 @@ static void acpi_power_resume_dependent(
> >  	list_for_each_entry(pn, &adev->physical_node_list, node)
> >  		pm_request_resume(pn->dev);
> >  
> > -	list_for_each_entry(pn, &adev->power_dependent, node)
> > -		pm_request_resume(pn->dev);
> > -
> >  	mutex_unlock(&adev->physical_node_lock);
> >  }
> >  
> > Index: linux-pm/drivers/acpi/scan.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/scan.c
> > +++ linux-pm/drivers/acpi/scan.c
> > @@ -1018,7 +1018,6 @@ int acpi_device_add(struct acpi_device *
> >  	INIT_LIST_HEAD(&device->wakeup_list);
> >  	INIT_LIST_HEAD(&device->physical_node_list);
> >  	mutex_init(&device->physical_node_lock);
> > -	INIT_LIST_HEAD(&device->power_dependent);
> >  
> >  	new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
> >  	if (!new_bus_id) {
> > 
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2013-06-18 12:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 12:29 [PATCH 0/4] ACPI / PM: Cleanups and device power state selection rework Rafael J. Wysocki
2013-06-14 12:31 ` [PATCH 1/4] ACPI / PM: Rename function acpi_device_power_state() and make it static Rafael J. Wysocki
2013-06-14 12:31 ` [PATCH 2/4] ACPI / PM: Replace ACPI_STATE_D3 with ACPI_STATE_D3_COLD in device_pm.c Rafael J. Wysocki
2013-06-14 12:32 ` [PATCH 3/4] ACPI / PM: Rework and clean up acpi_dev_pm_get_state() Rafael J. Wysocki
2013-06-27  8:11   ` Aaron Lu
2013-06-27 12:09     ` Rafael J. Wysocki
2013-06-28  7:53       ` Aaron Lu
2013-06-14 12:33 ` [PATCH 4/4] ACPI / PM: Drop two functions that are not used any more Rafael J. Wysocki
2013-06-18  9:20   ` Aaron Lu
2013-06-18 13:00     ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2356401.FiBQpSHJGJ@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=aaron.lu@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=tianyu.lan@intel.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.