mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drivers: fix CERT-C violations in max77851 driver
Cert-C fixes in max77851 mfd and pinctrl driver. CID:685661 CID:685622 CID:685626 CID:685637 Bug 3959323 Change-Id: I0a5fbd9d90ecc4c43d0967fdd4a9da7286aab1f5 Signed-off-by: Shubhi Garg <shgarg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2987950 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
25bd4163f9
commit
0b989c71b1
@@ -229,7 +229,11 @@ static int max77851_config_fps(struct max77851_chip *chip,
|
|||||||
fps_max_period = MAX77851_FPS_PERIOD_MAX_US;
|
fps_max_period = MAX77851_FPS_PERIOD_MAX_US;
|
||||||
|
|
||||||
for (fps_id = 0; fps_id < MX_FPS_MASTER_NUM; fps_id++) {
|
for (fps_id = 0; fps_id < MX_FPS_MASTER_NUM; fps_id++) {
|
||||||
sprintf(fps_name, "fps%d", fps_id);
|
ret = sprintf(fps_name, "fps%d", fps_id);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(dev, "sprintf failed with error status: 0x%x\n", ret);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
if (!strcmp(fps_np->name, fps_name))
|
if (!strcmp(fps_np->name, fps_name))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -627,8 +627,6 @@ static int max77851_pinconf_set(struct pinctrl_dev *pctldev,
|
|||||||
if (IS_GPIO(pin) || IS_NRSTIO(pin)) {
|
if (IS_GPIO(pin) || IS_NRSTIO(pin)) {
|
||||||
mask = GPIO_CFG0_SUP;
|
mask = GPIO_CFG0_SUP;
|
||||||
shift = FFS(GPIO_CFG0_SUP);
|
shift = FFS(GPIO_CFG0_SUP);
|
||||||
}
|
|
||||||
|
|
||||||
val = param_val;
|
val = param_val;
|
||||||
reg_addr = pcntl->pin_groups[pin].pin_cfg0_addr;
|
reg_addr = pcntl->pin_groups[pin].pin_cfg0_addr;
|
||||||
|
|
||||||
@@ -637,6 +635,7 @@ static int max77851_pinconf_set(struct pinctrl_dev *pctldev,
|
|||||||
dev_err(dev, "Input Supply GPIO update failed: %d\n", ret);
|
dev_err(dev, "Input Supply GPIO update failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAX77851_PU_SLPX_MASTER_SLOT:
|
case MAX77851_PU_SLPX_MASTER_SLOT:
|
||||||
|
|||||||
Reference in New Issue
Block a user