mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
mfd: da9052: Simplify getting of_device_id match data
Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
fac61e6931
commit
8b201402ea
1 changed files with 2 additions and 7 deletions
|
@ -155,13 +155,8 @@ static int da9052_i2c_probe(struct i2c_client *client,
|
|||
return ret;
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
if (!id) {
|
||||
struct device_node *np = client->dev.of_node;
|
||||
const struct of_device_id *deviceid;
|
||||
|
||||
deviceid = of_match_node(dialog_dt_ids, np);
|
||||
id = deviceid->data;
|
||||
}
|
||||
if (!id)
|
||||
id = of_device_get_match_data(&client->dev);
|
||||
#endif
|
||||
|
||||
if (!id) {
|
||||
|
|
Loading…
Add table
Reference in a new issue