[media] media: rc: gpio-ir-recv: use helper variable to access device info

Using explicit struct device variable makes code a bit more readable.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Ladislav Michl 2017-09-07 20:34:35 -03:00 committed by Mauro Carvalho Chehab
parent c25895c7d6
commit 94d40b2ff2

View File

@ -95,18 +95,18 @@ err_get_value:
static int gpio_ir_recv_probe(struct platform_device *pdev) static int gpio_ir_recv_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct gpio_rc_dev *gpio_dev; struct gpio_rc_dev *gpio_dev;
struct rc_dev *rcdev; struct rc_dev *rcdev;
const struct gpio_ir_recv_platform_data *pdata = const struct gpio_ir_recv_platform_data *pdata = dev->platform_data;
pdev->dev.platform_data;
int rc; int rc;
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
struct gpio_ir_recv_platform_data *dtpdata = struct gpio_ir_recv_platform_data *dtpdata =
devm_kzalloc(&pdev->dev, sizeof(*dtpdata), GFP_KERNEL); devm_kzalloc(dev, sizeof(*dtpdata), GFP_KERNEL);
if (!dtpdata) if (!dtpdata)
return -ENOMEM; return -ENOMEM;
rc = gpio_ir_recv_get_devtree_pdata(&pdev->dev, dtpdata); rc = gpio_ir_recv_get_devtree_pdata(dev, dtpdata);
if (rc) if (rc)
return rc; return rc;
pdata = dtpdata; pdata = dtpdata;
@ -135,7 +135,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
rcdev->input_id.vendor = 0x0001; rcdev->input_id.vendor = 0x0001;
rcdev->input_id.product = 0x0001; rcdev->input_id.product = 0x0001;
rcdev->input_id.version = 0x0100; rcdev->input_id.version = 0x0100;
rcdev->dev.parent = &pdev->dev; rcdev->dev.parent = dev;
rcdev->driver_name = GPIO_IR_DRIVER_NAME; rcdev->driver_name = GPIO_IR_DRIVER_NAME;
rcdev->min_timeout = 1; rcdev->min_timeout = 1;
rcdev->timeout = IR_DEFAULT_TIMEOUT; rcdev->timeout = IR_DEFAULT_TIMEOUT;
@ -159,7 +159,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
rc = rc_register_device(rcdev); rc = rc_register_device(rcdev);
if (rc < 0) { if (rc < 0) {
dev_err(&pdev->dev, "failed to register rc device\n"); dev_err(dev, "failed to register rc device (%d)\n", rc);
goto err_register_rc_device; goto err_register_rc_device;
} }