aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyo Kataoka <ryo.kataoka.wt@renesas.com>2019-03-22 20:50:31 +0900
committerRyo Kataoka <ryo.kataoka.wt@renesas.com>2019-03-22 20:50:31 +0900
commit1381140743fc2acd5b125b9adefad7717fada71b (patch)
tree4fb582392c868dad74ae8708d5e28b140818c3e3
parent71bf321b544c72ee6582839f8b7bd36acce577e5 (diff)
parent2fba5e0e94db930a24af406a39cd3a2c0353f15b (diff)
downloadrenesas-bsp-1381140743fc2acd5b125b9adefad7717fada71b.tar.gz
Merge branch 'rcar-3.9.2/adv748x.rc1' into v4.14.75-ltsi/rcar-3.9.3
* rcar-3.9.2/adv748x.rc1: media: i2c: adv748x: Use devm to allocate the device struct media: i2c: adv7482: Fix wait procedure usleep_range from msleep
-rw-r--r--drivers/media/i2c/adv748x/adv748x-core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index a57ccc47c93d2..da8f0621a10b5 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -1,7 +1,7 @@
/*
* Driver for Analog Devices ADV748X HDMI receiver with AFE
*
- * Copyright (C) 2017 Renesas Electronics Corp.
+ * Copyright (C) 2017-2019 Renesas Electronics Corp.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -273,7 +273,8 @@ static int adv748x_write_regs(struct adv748x_state *state,
while (regs->page != ADV748X_PAGE_EOR) {
if (regs->page == ADV748X_PAGE_WAIT) {
- msleep(regs->value);
+ usleep_range(regs->value * 1000,
+ (regs->value * 1000) + 1000);
} else {
ret = adv748x_write(state, regs->page, regs->reg,
regs->value);
@@ -848,7 +849,7 @@ static int adv748x_probe(struct i2c_client *client,
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
- state = kzalloc(sizeof(struct adv748x_state), GFP_KERNEL);
+ state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
if (!state)
return -ENOMEM;
@@ -946,7 +947,6 @@ err_cleanup_dt:
adv748x_dt_cleanup(state);
err_free_mutex:
mutex_destroy(&state->mutex);
- kfree(state);
return ret;
}
@@ -965,8 +965,6 @@ static int adv748x_remove(struct i2c_client *client)
adv748x_dt_cleanup(state);
mutex_destroy(&state->mutex);
- kfree(state);
-
return 0;
}