Skip to content

Commit 3f30e40

Browse files
peda-rWolfram Sang
authored andcommitted
[media] rtl2832: regmap is aware of lockdep, drop local locking hack
Tested-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent e01fc42 commit 3f30e40

2 files changed

Lines changed: 0 additions & 31 deletions

File tree

‎drivers/media/dvb-frontends/rtl2832.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -890,32 +890,6 @@ static bool rtl2832_volatile_reg(struct device *dev, unsigned int reg)
890890
return false;
891891
}
892892

893-
/*
894-
* FIXME: Hack. Implement own regmap locking in order to silence lockdep
895-
* recursive lock warning. That happens when regmap I2C client calls I2C mux
896-
* adapter, which leads demod I2C repeater enable via demod regmap. Operation
897-
* takes two regmap locks recursively - but those are different regmap instances
898-
* in a two different I2C drivers, so it is not deadlock. Proper fix is to make
899-
* regmap aware of lockdep.
900-
*/
901-
static void rtl2832_regmap_lock(void *__dev)
902-
{
903-
struct rtl2832_dev *dev = __dev;
904-
struct i2c_client *client = dev->client;
905-
906-
dev_dbg(&client->dev, "\n");
907-
mutex_lock(&dev->regmap_mutex);
908-
}
909-
910-
static void rtl2832_regmap_unlock(void *__dev)
911-
{
912-
struct rtl2832_dev *dev = __dev;
913-
struct i2c_client *client = dev->client;
914-
915-
dev_dbg(&client->dev, "\n");
916-
mutex_unlock(&dev->regmap_mutex);
917-
}
918-
919893
static struct dvb_frontend *rtl2832_get_dvb_frontend(struct i2c_client *client)
920894
{
921895
struct rtl2832_dev *dev = i2c_get_clientdata(client);
@@ -1082,12 +1056,8 @@ static int rtl2832_probe(struct i2c_client *client,
10821056
dev->sleeping = true;
10831057
INIT_DELAYED_WORK(&dev->i2c_gate_work, rtl2832_i2c_gate_work);
10841058
/* create regmap */
1085-
mutex_init(&dev->regmap_mutex);
10861059
dev->regmap_config.reg_bits = 8,
10871060
dev->regmap_config.val_bits = 8,
1088-
dev->regmap_config.lock = rtl2832_regmap_lock,
1089-
dev->regmap_config.unlock = rtl2832_regmap_unlock,
1090-
dev->regmap_config.lock_arg = dev,
10911061
dev->regmap_config.volatile_reg = rtl2832_volatile_reg,
10921062
dev->regmap_config.max_register = 5 * 0x100,
10931063
dev->regmap_config.ranges = regmap_range_cfg,

‎drivers/media/dvb-frontends/rtl2832_priv.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
struct rtl2832_dev {
3434
struct rtl2832_platform_data *pdata;
3535
struct i2c_client *client;
36-
struct mutex regmap_mutex;
3736
struct regmap_config regmap_config;
3837
struct regmap *regmap;
3938
struct i2c_mux_core *muxc;

0 commit comments

Comments
 (0)