diff mbox

[2/4] ACPI / LPSS: drop clkdev_name member from lpss_device_desc

Message ID 1409644510-26397-3-git-send-email-heikki.krogerus@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Heikki Krogerus Sept. 2, 2014, 7:55 a.m. UTC
It was used to provide the correct con_id for the dma
driver, but it's not needed. Even if the driver requests a
clock with the con_id, it still gets the correct clock. The
device name is enough to match a single clock.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/acpi/acpi_lpss.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Andy Shevchenko Sept. 2, 2014, 8:43 a.m. UTC | #1
On Tue, 2014-09-02 at 10:55 +0300, Heikki Krogerus wrote:
> It was used to provide the correct con_id for the dma
> driver, but it's not needed. Even if the driver requests a
> clock with the con_id, it still gets the correct clock. The

Maybe with -> without?

> device name is enough to match a single clock.

Since it affects DW DMA driver
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/acpi/acpi_lpss.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index 4723a0e..db3498b 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -70,7 +70,6 @@ struct lpss_shared_clock {
>  struct lpss_private_data;
>  
>  struct lpss_device_desc {
> -	const char *clkdev_name;
>  	unsigned int flags;
>  	unsigned int prv_offset;
>  	size_t prv_size_override;
> @@ -79,7 +78,6 @@ struct lpss_device_desc {
>  };
>  
>  static struct lpss_device_desc lpss_dma_desc = {
> -	.clkdev_name = "hclk",
>  	.flags = LPSS_CLK,
>  };
>  
> @@ -268,12 +266,7 @@ static int register_device_clock(struct acpi_device *adev,
>  	clk_data = platform_get_drvdata(lpss_clk_dev);
>  	if (!clk_data)
>  		return -ENODEV;
> -
> -	if (dev_desc->clkdev_name) {
> -		clk_register_clkdev(clk_data->clk, dev_desc->clkdev_name,
> -				    devname);
> -		return 0;
> -	}
> +	clk = clk_data->clk;
>  
>  	if (!pdata->mmio_base
>  	    || pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE)
Heikki Krogerus Sept. 2, 2014, 10:34 a.m. UTC | #2
On Tue, Sep 02, 2014 at 11:43:16AM +0300, Andy Shevchenko wrote:
> On Tue, 2014-09-02 at 10:55 +0300, Heikki Krogerus wrote:
> > It was used to provide the correct con_id for the dma
> > driver, but it's not needed. Even if the driver requests a
> > clock with the con_id, it still gets the correct clock. The
> 
> Maybe with -> without?

No. What I'm trying say is that even though the dma engine driver
requests the clock like this:

        dw->clk = devm_clk_get(chip->dev, "hclk")

i.e. _with_ the con_id "hclk", it will still get the correct
reference because..

> > device name is enough to match a single clock.


Cheers,
Andy Shevchenko Sept. 2, 2014, 10:42 a.m. UTC | #3
On Tue, 2014-09-02 at 13:34 +0300, Heikki Krogerus wrote:
> On Tue, Sep 02, 2014 at 11:43:16AM +0300, Andy Shevchenko wrote:
> > On Tue, 2014-09-02 at 10:55 +0300, Heikki Krogerus wrote:
> > > It was used to provide the correct con_id for the dma
> > > driver, but it's not needed. Even if the driver requests a
> > > clock with the con_id, it still gets the correct clock. The
> > 
> > Maybe with -> without?
> 
> No. What I'm trying say is that even though the dma engine driver
> requests the clock like this:
> 
>         dw->clk = devm_clk_get(chip->dev, "hclk")
> 
> i.e. _with_ the con_id "hclk", it will still get the correct
> reference because..
> > > device name is enough to match a single clock.

Fair enough.
diff mbox

Patch

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 4723a0e..db3498b 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -70,7 +70,6 @@  struct lpss_shared_clock {
 struct lpss_private_data;
 
 struct lpss_device_desc {
-	const char *clkdev_name;
 	unsigned int flags;
 	unsigned int prv_offset;
 	size_t prv_size_override;
@@ -79,7 +78,6 @@  struct lpss_device_desc {
 };
 
 static struct lpss_device_desc lpss_dma_desc = {
-	.clkdev_name = "hclk",
 	.flags = LPSS_CLK,
 };
 
@@ -268,12 +266,7 @@  static int register_device_clock(struct acpi_device *adev,
 	clk_data = platform_get_drvdata(lpss_clk_dev);
 	if (!clk_data)
 		return -ENODEV;
-
-	if (dev_desc->clkdev_name) {
-		clk_register_clkdev(clk_data->clk, dev_desc->clkdev_name,
-				    devname);
-		return 0;
-	}
+	clk = clk_data->clk;
 
 	if (!pdata->mmio_base
 	    || pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE)