usb: host: ohci-pxa27x: use of_property_read_bool()
Subsystems (2)
PATCH 1/1 usb: host: ohci-pxa27x: use of_property_read_bool()
for checking if a property is present or not, of_property_read_bool is more appropriate then of_get_property()
Signed-off-by Saurabh Sengar <[email protected]>
--- drivers/usb/host/ohci-pxa27x.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/host/ohci-pxa27x.c +7 -7
@@ -365,19 +365,19 @@ static int ohci_pxa_of_init(struct platform_device *pdev)if (!pdata)return -ENOMEM ; -if (of_get_property (np,"marvell,enable-port1" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port1" )) pdata->flags |=ENABLE_PORT1 ; -if (of_get_property (np,"marvell,enable-port2" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port2" )) pdata->flags |=ENABLE_PORT2 ; -if (of_get_property (np,"marvell,enable-port3" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port3" )) pdata->flags |=ENABLE_PORT3 ; -if (of_get_property (np,"marvell,port-sense-low" ,NULL )) +if (of_property_read_bool (np,"marvell,port-sense-low" )) pdata->flags |=POWER_SENSE_LOW ; -if (of_get_property (np,"marvell,power-control-low" ,NULL )) +if (of_property_read_bool (np,"marvell,power-control-low" )) pdata->flags |=POWER_CONTROL_LOW ; -if (of_get_property (np,"marvell,no-oc-protection" ,NULL )) +if (of_property_read_bool (np,"marvell,no-oc-protection" )) pdata->flags |=NO_OC_PROTECTION ; -if (of_get_property (np,"marvell,oc-mode-perport" ,NULL )) +if (of_property_read_bool (np,"marvell,oc-mode-perport" )) pdata->flags |=OC_MODE_PERPORT ;if (!of_property_read_u32 (np,"marvell,power-on-delay" , &tmp)) pdata->power_on_delay = tmp;
Signature · 1 line
1.9.1
Hello.
Quoted 2 lines · Saurabh Sengar
for checking if a property is present or not,
of_property_read_boolis more appropriate thenof_get_property()
s/then/than/.
Quoted 1 line
Signed-off-by Saurabh Sengar <[email protected]>
[...]
MBR, Sergei
PATCH v2 1/1 usb: host: ohci-pxa27x: use of_property_read_bool()
for checking if a property is present or not, of_property_read_bool is more appropriate than of_get_property()
Signed-off-by Saurabh Sengar <[email protected]>
---
v2 : replaced then to than in description
drivers/usb/host/ohci-pxa27x.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/host/ohci-pxa27x.c +7 -7
@@ -365,19 +365,19 @@ static int ohci_pxa_of_init(struct platform_device *pdev)if (!pdata)return -ENOMEM ; -if (of_get_property (np,"marvell,enable-port1" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port1" )) pdata->flags |=ENABLE_PORT1 ; -if (of_get_property (np,"marvell,enable-port2" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port2" )) pdata->flags |=ENABLE_PORT2 ; -if (of_get_property (np,"marvell,enable-port3" ,NULL )) +if (of_property_read_bool (np,"marvell,enable-port3" )) pdata->flags |=ENABLE_PORT3 ; -if (of_get_property (np,"marvell,port-sense-low" ,NULL )) +if (of_property_read_bool (np,"marvell,port-sense-low" )) pdata->flags |=POWER_SENSE_LOW ; -if (of_get_property (np,"marvell,power-control-low" ,NULL )) +if (of_property_read_bool (np,"marvell,power-control-low" )) pdata->flags |=POWER_CONTROL_LOW ; -if (of_get_property (np,"marvell,no-oc-protection" ,NULL )) +if (of_property_read_bool (np,"marvell,no-oc-protection" )) pdata->flags |=NO_OC_PROTECTION ; -if (of_get_property (np,"marvell,oc-mode-perport" ,NULL )) +if (of_property_read_bool (np,"marvell,oc-mode-perport" )) pdata->flags |=OC_MODE_PERPORT ;if (!of_property_read_u32 (np,"marvell,power-on-delay" , &tmp)) pdata->power_on_delay = tmp;
Signature · 1 line
1.9.1
Quoted 6 lines · Saurabh Sengar
for checking if a property is present or not,
of_property_read_boolis more appropriate thanof_get_property()Signed-off-by Saurabh Sengar <[email protected]>---
v2 : replaced then to than in description
Acked-by Alan Stern <[email protected]>