diff options
| author | dmitry pervushin <dpervushin@nvidia.com> | 2020-02-05 10:06:26 -0500 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-03-23 04:08:57 -0400 |
| commit | bb58b407d9af680c1e03b7ab41df25c097c8d2f2 (patch) | |
| tree | 4c349bab07d33b91b879ca13abe39a5b5172d7a0 /drivers/virt/tegra/vm_err.c | |
| parent | 44eb35c1842bc2ec2709819eb38c8f2ef00ece7e (diff) | |
vmerr handler: platform resources fix
Current code copied struct device and performed operations on it
Instead, we should do devm_... calls with pointer to original device
Bug 2835333
Change-Id: I9d26573b009783e0b32de9742282fd8f83ca583a
Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2290442
(cherry picked from commit 4d9f8faba698dbad94342d34166ad7cb2507de6f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2315429
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hardik T Shah <hardikts@nvidia.com>
Reviewed-by: Phoenix Jung <pjung@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/virt/tegra/vm_err.c')
| -rw-r--r-- | drivers/virt/tegra/vm_err.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/virt/tegra/vm_err.c b/drivers/virt/tegra/vm_err.c index 795579a78..02aaf5779 100644 --- a/drivers/virt/tegra/vm_err.c +++ b/drivers/virt/tegra/vm_err.c | |||
| @@ -212,13 +212,13 @@ void tegra_hv_get_config(struct tegra_hv_config *cfg) | |||
| 212 | } | 212 | } |
| 213 | EXPORT_SYMBOL(tegra_hv_get_config); | 213 | EXPORT_SYMBOL(tegra_hv_get_config); |
| 214 | 214 | ||
| 215 | static int virq_handler_init(const struct platform_device *pdev) | 215 | static int virq_handler_init(struct platform_device *pdev) |
| 216 | { | 216 | { |
| 217 | int ret; | 217 | int ret; |
| 218 | struct irq_data *peer_err_irq_data; | 218 | struct irq_data *peer_err_irq_data; |
| 219 | int lin_peer_err_irq_id; | 219 | int lin_peer_err_irq_id; |
| 220 | struct tegra_hv_err_ctrl *ctrl = platform_get_drvdata(pdev); | 220 | struct tegra_hv_err_ctrl *ctrl = platform_get_drvdata(pdev); |
| 221 | struct device dev = pdev->dev; | 221 | struct device *dev = &pdev->dev; |
| 222 | 222 | ||
| 223 | dev_info(ctrl->dev, "Error notification HV IRQ id: %d\n", | 223 | dev_info(ctrl->dev, "Error notification HV IRQ id: %d\n", |
| 224 | ctrl->hv_peer_err_irq_id); | 224 | ctrl->hv_peer_err_irq_id); |
| @@ -242,13 +242,13 @@ static int virq_handler_init(const struct platform_device *pdev) | |||
| 242 | 242 | ||
| 243 | tegra_hv_virq_intr_prop.value = tegra_hv_virq_intr_info; | 243 | tegra_hv_virq_intr_prop.value = tegra_hv_virq_intr_info; |
| 244 | 244 | ||
| 245 | if (of_add_property(dev.of_node, &tegra_hv_virq_intr_prop)) { | 245 | if (of_add_property(dev->of_node, &tegra_hv_virq_intr_prop)) { |
| 246 | dev_err(ctrl->dev, "%s: failed to add interrupts property\n", | 246 | dev_err(ctrl->dev, "%s: failed to add interrupts property\n", |
| 247 | __func__); | 247 | __func__); |
| 248 | return -EACCES; | 248 | return -EACCES; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | lin_peer_err_irq_id = of_irq_get(dev.of_node, 0); | 251 | lin_peer_err_irq_id = of_irq_get(dev->of_node, 0); |
| 252 | if (lin_peer_err_irq_id < 0) { | 252 | if (lin_peer_err_irq_id < 0) { |
| 253 | dev_err(ctrl->dev, "%s: Unable to get Linux irq for id %d\n", | 253 | dev_err(ctrl->dev, "%s: Unable to get Linux irq for id %d\n", |
| 254 | __func__, ctrl->hv_peer_err_irq_id); | 254 | __func__, ctrl->hv_peer_err_irq_id); |
| @@ -262,12 +262,12 @@ static int virq_handler_init(const struct platform_device *pdev) | |||
| 262 | return -ENODEV; | 262 | return -ENODEV; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | ret = devm_request_irq(&dev, lin_peer_err_irq_id, async_err_handler, | 265 | ret = devm_request_irq(dev, lin_peer_err_irq_id, async_err_handler, |
| 266 | IRQ_NOTHREAD, dev_name(&dev), ctrl); | 266 | IRQ_NOTHREAD, dev_name(dev), ctrl); |
| 267 | if (ret < 0) { | 267 | if (ret < 0) { |
| 268 | dev_err(ctrl->dev, | 268 | dev_err(ctrl->dev, |
| 269 | "%s: failed to register IRQ %d, Err %d, %s\n", | 269 | "%s: failed to register IRQ %d, Err %d, %s\n", |
| 270 | __func__, lin_peer_err_irq_id, ret, pdev->name); | 270 | __func__, lin_peer_err_irq_id, ret, dev_name(dev)); |
| 271 | return ret; | 271 | return ret; |
| 272 | } | 272 | } |
| 273 | dev_info(ctrl->dev, "Registered Linux IRQ %d for peer notification\n", | 273 | dev_info(ctrl->dev, "Registered Linux IRQ %d for peer notification\n", |
