On Tue, Jan 19, 2010 at 2:58 AM, Grant Likely <[email protected]> wrote:
> On Mon, Jan 18, 2010 at 2:50 AM,  <[email protected]> wrote:
>> From: Jassi Brar <[email protected]>
>>
>> The instance of SPI clock for controller and that used for generating
>> signals ought to be independently handled.
>>
>> Signed-off-by: Jassi Brar <[email protected]>
>
> Will this patch break existing users of the driver that depend on the
> sci->src_clk checks?
No, it won't break.
Current driver in the tree can't be used at all since there is no platform stuff
there that is essential for even the probe to be called.

>
> g.
>
>> ---
>>  drivers/spi/spi_s3c64xx.c |   28 ++++++++--------------------
>>  1 files changed, 8 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
>> index ad93d5d..6d03d8f 100644
>> --- a/drivers/spi/spi_s3c64xx.c
>> +++ b/drivers/spi/spi_s3c64xx.c
>> @@ -1000,10 +1000,7 @@ static int __init s3c64xx_spi_probe(struct 
>> platform_device *pdev)
>>                goto err4;
>>        }
>>
>> -       if (sci->src_clk_nr == S3C64XX_SPI_SRCCLK_PCLK)
>> -               sci->src_clk = sdd->clk;
>> -       else
>> -               sci->src_clk = clk_get(&pdev->dev, sci->src_clk_name);
>> +       sci->src_clk = clk_get(&pdev->dev, sci->src_clk_name);
>>        if (IS_ERR(sci->src_clk)) {
>>                dev_err(&pdev->dev,
>>                        "Unable to acquire clock '%s'\n", sci->src_clk_name);
>> @@ -1011,7 +1008,7 @@ static int __init s3c64xx_spi_probe(struct 
>> platform_device *pdev)
>>                goto err5;
>>        }
>>
>> -       if (sci->src_clk != sdd->clk && clk_enable(sci->src_clk)) {
>> +       if (clk_enable(sci->src_clk)) {
>>                dev_err(&pdev->dev, "Couldn't enable clock '%s'\n",
>>                                                        sci->src_clk_name);
>>                ret = -EBUSY;
>> @@ -1053,11 +1050,9 @@ static int __init s3c64xx_spi_probe(struct 
>> platform_device *pdev)
>>  err8:
>>        destroy_workqueue(sdd->workqueue);
>>  err7:
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_disable(sci->src_clk);
>> +       clk_disable(sci->src_clk);
>>  err6:
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_put(sci->src_clk);
>> +       clk_put(sci->src_clk);
>>  err5:
>>        clk_disable(sdd->clk);
>>  err4:
>> @@ -1093,11 +1088,8 @@ static int s3c64xx_spi_remove(struct platform_device 
>> *pdev)
>>
>>        destroy_workqueue(sdd->workqueue);
>>
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_disable(sci->src_clk);
>> -
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_put(sci->src_clk);
>> +       clk_disable(sci->src_clk);
>> +       clk_put(sci->src_clk);
>>
>>        clk_disable(sdd->clk);
>>        clk_put(sdd->clk);
>> @@ -1130,9 +1122,7 @@ static int s3c64xx_spi_suspend(struct platform_device 
>> *pdev, pm_message_t state)
>>                msleep(10);
>>
>>        /* Disable the clock */
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_disable(sci->src_clk);
>> -
>> +       clk_disable(sci->src_clk);
>>        clk_disable(sdd->clk);
>>
>>        sdd->cur_speed = 0; /* Output Clock is stopped */
>> @@ -1150,9 +1140,7 @@ static int s3c64xx_spi_resume(struct platform_device 
>> *pdev)
>>        sci->cfg_gpio(pdev);
>>
>>        /* Enable the clock */
>> -       if (sci->src_clk != sdd->clk)
>> -               clk_enable(sci->src_clk);
>> -
>> +       clk_enable(sci->src_clk);
>>        clk_enable(sdd->clk);
>>
>>        s3c64xx_spi_hwinit(sdd, pdev->id);
>> --
>> 1.6.2.5
>>
>>
>
>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to