{
struct tas571x_private *priv;
struct device *dev = &client->dev;
+ const struct of_device_id *of_id;
int i, ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
return -ENOMEM;
i2c_set_clientdata(client, priv);
- if (dev->of_node) {
- const struct of_device_id *of_id;
-
- of_id = of_match_device(tas571x_of_match, dev);
- if (of_id)
- priv->chip = of_id->data;
- }
-
- if (!priv->chip) {
+ of_id = of_match_device(tas571x_of_match, dev);
+ if (!of_id) {
dev_err(dev, "Unknown device type\n");
return -EINVAL;
}
+ priv->chip = of_id->data;
priv->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {