mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
serial: max310x: Add error checking in probe()
[ Upstream commit 672a37ba8af1f2ebcedeb94aea2cdd047f805f30 ]
Check if devm_i2c_new_dummy_device() fails.
Fixes: 2e1f2d9a9b ("serial: max310x: implement I2C support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aJTMPZiKqeXSE-KM@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ac4d189aaa
commit
ef3600c6fe
@@ -1659,6 +1659,8 @@ static int max310x_i2c_probe(struct i2c_client *client)
|
||||
port_client = devm_i2c_new_dummy_device(&client->dev,
|
||||
client->adapter,
|
||||
port_addr);
|
||||
if (IS_ERR(port_client))
|
||||
return PTR_ERR(port_client);
|
||||
|
||||
regmaps[i] = devm_regmap_init_i2c(port_client, ®cfg_i2c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user