mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
soc: qcom: glink_pkt: Fix minor version in device creation
'ret' was used to store the minor version obtained from ida_simple_get. This was overwritten with the return value of glink_pkt_parse_devicetree. Hence, saving the return value in 'minor' and passing in this new variable, 'minor' to create a glink_pkt device. Change-Id: I5dff8e01e27501171146df782c93d110d6592047 Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
This commit is contained in:
parent
6da1fc6d98
commit
78fae6cdf9
1 changed files with 7 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
|
|
@ -700,17 +700,17 @@ static int glink_pkt_create_device(struct device *parent,
|
|||
{
|
||||
struct glink_pkt_device *gpdev;
|
||||
struct device *dev;
|
||||
int ret;
|
||||
int ret, minor;
|
||||
|
||||
gpdev = kzalloc(sizeof(*gpdev), GFP_KERNEL);
|
||||
if (!gpdev)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = ida_simple_get(&glink_pkt_minor_ida, 0, num_glink_pkt_devs,
|
||||
minor = ida_simple_get(&glink_pkt_minor_ida, 0, num_glink_pkt_devs,
|
||||
GFP_KERNEL);
|
||||
if (ret < 0) {
|
||||
if (minor < 0) {
|
||||
kfree(gpdev);
|
||||
return ret;
|
||||
return minor;
|
||||
}
|
||||
|
||||
dev = &gpdev->dev;
|
||||
|
|
@ -744,8 +744,8 @@ static int glink_pkt_create_device(struct device *parent,
|
|||
cdev_init(&gpdev->cdev, &glink_pkt_fops);
|
||||
gpdev->cdev.owner = THIS_MODULE;
|
||||
|
||||
dev->devt = MKDEV(MAJOR(glink_pkt_major), ret);
|
||||
dev_set_name(dev, gpdev->dev_name, ret);
|
||||
dev->devt = MKDEV(MAJOR(glink_pkt_major), minor);
|
||||
dev_set_name(dev, gpdev->dev_name, minor);
|
||||
|
||||
ret = cdev_add(&gpdev->cdev, dev->devt, 1);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue