Commit 28d48f04 authored by Grazvydas Ignotas's avatar Grazvydas Ignotas Committed by Anton Vorontsov

twl4030_charger: Fix warnings

Fix warnings emitted by some versions of gcc:
drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversion

While at it, also fix module_param permissions and a typo in my name.
Signed-off-by: default avatarGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent ccf8fa2d
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#define TWL4030_MSTATEC_COMPLETE4 0x0e #define TWL4030_MSTATEC_COMPLETE4 0x0e
static bool allow_usb; static bool allow_usb;
module_param(allow_usb, bool, 1); module_param(allow_usb, bool, 0644);
MODULE_PARM_DESC(allow_usb, "Allow USB charge drawing default current"); MODULE_PARM_DESC(allow_usb, "Allow USB charge drawing default current");
struct twl4030_bci { struct twl4030_bci {
...@@ -425,7 +425,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) ...@@ -425,7 +425,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
{ {
struct twl4030_bci *bci; struct twl4030_bci *bci;
int ret; int ret;
int reg; u32 reg;
bci = kzalloc(sizeof(*bci), GFP_KERNEL); bci = kzalloc(sizeof(*bci), GFP_KERNEL);
if (bci == NULL) if (bci == NULL)
...@@ -486,7 +486,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) ...@@ -486,7 +486,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
} }
/* Enable interrupts now. */ /* Enable interrupts now. */
reg = ~(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 | reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
TWL4030_TBATOR1 | TWL4030_BATSTS); TWL4030_TBATOR1 | TWL4030_BATSTS);
ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg, ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
TWL4030_INTERRUPTS_BCIIMR1A); TWL4030_INTERRUPTS_BCIIMR1A);
...@@ -495,7 +495,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) ...@@ -495,7 +495,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
goto fail_unmask_interrupts; goto fail_unmask_interrupts;
} }
reg = ~(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV); reg = ~(u32)(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg, ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
TWL4030_INTERRUPTS_BCIIMR2A); TWL4030_INTERRUPTS_BCIIMR2A);
if (ret < 0) if (ret < 0)
...@@ -572,7 +572,7 @@ static void __exit twl4030_bci_exit(void) ...@@ -572,7 +572,7 @@ static void __exit twl4030_bci_exit(void)
} }
module_exit(twl4030_bci_exit); module_exit(twl4030_bci_exit);
MODULE_AUTHOR("Gražydas Ignotas"); MODULE_AUTHOR("Gražvydas Ignotas");
MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver"); MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:twl4030_bci"); MODULE_ALIAS("platform:twl4030_bci");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment