[PATCH v2] [media] marvell-ccic: simplify and fix clk handling (a bit)

Jonathan Corbet corbet at lwn.net
Wed Sep 25 03:15:20 EDT 2013


On Tue, 24 Sep 2013 20:59:47 +0200
Uwe Kleine-König <u.kleine-koenig at pengutronix.de> wrote:

> The marvell-ccic does several things wrong or ineffectively in the clock
> handling and it's usage of the devm_* stuff
> 
>  - it assumes clk_get doesn't return NULL
>  - it explicitly calls devm_clk_put instead just keeping the reference
>    during it's lifetime and let the driver core call it
>  - it calls kfree, gpio_free and free_irq for resources it requested
>    using devm_kzalloc, devm_gpio_request and devm_request_irq
>    respectively.
>  - it mixes devm_ and unmanaged resources which probably results in a
>    race condition during remove

OK, all of that stuff was added this time around by Libin; my
understanding of that particular hardware is ... minimal.  The basic
idea of the patch seems sound.  I do note, though, that you've changed
the behavior of the driver somewhat.  The MIPI clock is current
obtained at power-up time and released on power-down; you've moved it
to probe time instead, and it's held for the lifetime of the driver.
Perhaps that's even better, I don't know...Libin, what do you say on
that?

The free_irq() call is also removed by a patch previously submitted by
Wei Yongjun.

> This patch fixes all but the last issue in this list. This patch doesn't
> introduce new reasons for not building, but there are already several
> bulid problems.

Care to report those?

Thanks,

jon



More information about the linux-arm-kernel mailing list