diff mbox

regulator: twl6030: add dependency on OF

Message ID 20161125074335.6947-1-Nicolae_Rosia@mentor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolae Rosia Nov. 25, 2016, 7:43 a.m. UTC
This driver was converted to device tree only,
add dependency on OF symbol and drop of_match_ptr

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
 drivers/regulator/Kconfig             | 1 +
 drivers/regulator/twl6030-regulator.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown Nov. 25, 2016, 1:03 p.m. UTC | #1
On Fri, Nov 25, 2016 at 09:43:35AM +0200, Nicolae Rosia wrote:

> This driver was converted to device tree only,
> add dependency on OF symbol and drop of_match_ptr

These are two different changes :(

>  config REGULATOR_TWL4030
>  	tristate "TI TWL4030/TWL5030/TWL6030/TPS659x0 PMIC"
>  	depends on TWL4030_CORE
> +	depends on OF

This should be OF || COMPILE_TEST so people can still get build coverage
without DT.

> --- a/drivers/regulator/twl6030-regulator.c
> +++ b/drivers/regulator/twl6030-regulator.c
> @@ -773,7 +773,7 @@ static struct platform_driver twlreg_driver = {
>  	 */
>  	.driver  = {
>  		.name  = "twl6030_reg",
> -		.of_match_table = of_match_ptr(twl_of_match),
> +		.of_match_table = twl_of_match,

This buys us nothing, it's not going to make any practical difference
but on the other hand it costs nothing to have it there either.  The
only impact I can see this having is causing someone doing a cut'n'paste
to miss the of_match_ptr() out.
Nicolae Rosia Nov. 25, 2016, 1:09 p.m. UTC | #2
Hi,

On Fri, Nov 25, 2016 at 3:03 PM, Mark Brown <broonie@kernel.org> wrote:
> On Fri, Nov 25, 2016 at 09:43:35AM +0200, Nicolae Rosia wrote:
>
>> This driver was converted to device tree only,
>> add dependency on OF symbol and drop of_match_ptr
>
> These are two different changes :(
>
Ok, will send a patch only for Kconfig.

>>  config REGULATOR_TWL4030
>>       tristate "TI TWL4030/TWL5030/TWL6030/TPS659x0 PMIC"
>>       depends on TWL4030_CORE
>> +     depends on OF
>
> This should be OF || COMPILE_TEST so people can still get build coverage
> without DT.
>
Ok.

>> --- a/drivers/regulator/twl6030-regulator.c
>> +++ b/drivers/regulator/twl6030-regulator.c
>> @@ -773,7 +773,7 @@ static struct platform_driver twlreg_driver = {
>>        */
>>       .driver  = {
>>               .name  = "twl6030_reg",
>> -             .of_match_table = of_match_ptr(twl_of_match),
>> +             .of_match_table = twl_of_match,
>
> This buys us nothing, it's not going to make any practical difference
> but on the other hand it costs nothing to have it there either.  The
> only impact I can see this having is causing someone doing a cut'n'paste
> to miss the of_match_ptr() out.
I did this because I received a comment on another patch [0].

Thanks,
Nicolae

[0] https://patchwork.ozlabs.org/patch/694021/
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Nov. 25, 2016, 1:17 p.m. UTC | #3
On Fri, Nov 25, 2016 at 03:09:43PM +0200, Nicolae Rosia wrote:
> On Fri, Nov 25, 2016 at 3:03 PM, Mark Brown <broonie@kernel.org> wrote:

> >> -             .of_match_table = of_match_ptr(twl_of_match),
> >> +             .of_match_table = twl_of_match,

> > This buys us nothing, it's not going to make any practical difference
> > but on the other hand it costs nothing to have it there either.  The
> > only impact I can see this having is causing someone doing a cut'n'paste
> > to miss the of_match_ptr() out.

> I did this because I received a comment on another patch [0].

OK, but that still doesn't really explain what the benefit is!
diff mbox

Patch

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 936f7cc..ef70672 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -839,6 +839,7 @@  config REGULATOR_TPS80031
 config REGULATOR_TWL4030
 	tristate "TI TWL4030/TWL5030/TWL6030/TPS659x0 PMIC"
 	depends on TWL4030_CORE
+	depends on OF
 	help
 	  This driver supports the voltage regulators provided by
 	  this family of companion chips.
diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c
index 4864b9d..1f327d7 100644
--- a/drivers/regulator/twl6030-regulator.c
+++ b/drivers/regulator/twl6030-regulator.c
@@ -773,7 +773,7 @@  static struct platform_driver twlreg_driver = {
 	 */
 	.driver  = {
 		.name  = "twl6030_reg",
-		.of_match_table = of_match_ptr(twl_of_match),
+		.of_match_table = twl_of_match,
 	},
 };