From: t.stanislaws@samsung.com (Tomasz Stanislawski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 4/4] media: s5p-tv: Fix mixer driver to work with CCF
Date: Wed, 25 Sep 2013 18:10:52 +0200 [thread overview]
Message-ID: <52430B0C.9080702@samsung.com> (raw)
In-Reply-To: <52403799.7020103@samsung.com>
On 09/23/2013 02:44 PM, Sylwester Nawrocki wrote:
> On 21/09/13 17:00, Mateusz Krawczuk wrote:
>> Replace clk_enable by clock_enable_prepare and clk_disable with clk_disable_unprepare.
>> Clock prepare is required by Clock Common Framework, and old clock driver didn`t support it.
>> Without it Common Clock Framework prints a warning.
>
> nit: Please wrap this text to not exceed 80 columns.
>
>> Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> drivers/media/platform/s5p-tv/mixer_drv.c | 34 +++++++++++++++++++++++++------
>> 1 file changed, 28 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c
>> index 8ce7c3e..7eea286 100644
>> --- a/drivers/media/platform/s5p-tv/mixer_drv.c
>> +++ b/drivers/media/platform/s5p-tv/mixer_drv.c
>> @@ -347,19 +347,41 @@ static int mxr_runtime_resume(struct device *dev)
>> {
>> struct mxr_device *mdev = to_mdev(dev);
>> struct mxr_resources *res = &mdev->res;
>> + int ret;
>>
>> dev_dbg(mdev->dev, "resume - start\n");
>> mutex_lock(&mdev->mutex);
>> /* turn clocks on */
>> - clk_enable(res->mixer);
>> - clk_enable(res->vp);
>> - clk_enable(res->sclk_mixer);
>> + ret = clk_prepare_enable(res->mixer);
>> + if (ret < 0) {
>> + dev_err(mdev->dev, "clk_prepare_enable(mixer) failed\n");
>> + goto fail;
>> + }
>> + ret = clk_prepare_enable(res->vp);
>> + if (ret < 0) {
>> + dev_err(mdev->dev, "clk_prepare_enable(vp) failed\n");
>> + goto fail_mixer;
>> + }
>> + ret = clk_prepare_enable(res->sclk_mixer);
>> + if (ret < 0) {
>> + dev_err(mdev->dev, "clk_prepare_enable(sclk_mixer) failed\n");
>> + goto fail_vp;
>> + }
>> /* apply default configuration */
>> mxr_reg_reset(mdev);
>> dev_dbg(mdev->dev, "resume - finished\n");
>>
>> mutex_unlock(&mdev->mutex);
>> return 0;
>> +
>> +fail_vp:
>> + clk_disable_unprepare(res->vp);
>> +fail_mixer:
>> + clk_disable_unprepare(res->mixer);
>> +fail:
>
> How about only one error log here if any of the clk_prepare_enable() calls
> fails ? I'm not sure if we need a separate log for each single clock.
>
I think it would nice to know which clock caused a failure.
>> + mutex_unlock(&mdev->mutex);
>> + dev_err(mdev->dev, "resume failed\n");
>> + return ret;
>> }
>
> Regards,
> Sylwester
>
next prev parent reply other threads:[~2013-09-25 16:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-21 15:00 [PATCH v5 0/4] media: s5p-tv: clean-up and fixes Mateusz Krawczuk
2013-09-21 15:00 ` [PATCH v5 1/4] media: s5p-tv: Replace mxr_ macro by default dev_ Mateusz Krawczuk
2013-09-23 14:50 ` Tomasz Stanislawski
2013-09-23 15:48 ` Bartlomiej Zolnierkiewicz
2013-09-23 17:44 ` Joe Perches
2013-09-24 12:52 ` Tomasz Stanislawski
2013-09-24 15:35 ` Bartlomiej Zolnierkiewicz
2013-09-24 16:24 ` Joe Perches
2013-09-24 9:43 ` Tomasz Stanislawski
2013-09-24 10:33 ` Bartlomiej Zolnierkiewicz
2013-09-24 13:02 ` Mauro Carvalho Chehab
2013-09-21 15:00 ` [PATCH v5 2/4] media: s5p-tv: Restore vpll clock rate Mateusz Krawczuk
2013-09-25 15:46 ` Tomasz Stanislawski
2013-10-12 10:06 ` Sylwester Nawrocki
2013-09-21 15:00 ` [PATCH v5 3/4] media: s5p-tv: Fix sdo driver to work with CCF Mateusz Krawczuk
2013-09-25 15:59 ` Tomasz Stanislawski
2013-10-12 10:25 ` Sylwester Nawrocki
2013-09-21 15:00 ` [PATCH v5 4/4] media: s5p-tv: Fix mixer " Mateusz Krawczuk
2013-09-23 12:44 ` Sylwester Nawrocki
2013-09-25 16:10 ` Tomasz Stanislawski [this message]
2013-09-25 16:09 ` Tomasz Stanislawski
2013-10-12 10:27 ` Sylwester Nawrocki
2013-09-23 3:52 ` [PATCH v5 0/4] media: s5p-tv: clean-up and fixes Sachin Kamat
2013-09-23 12:26 ` Tomasz Figa
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=52430B0C.9080702@samsung.com \
--to=t.stanislaws@samsung.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox