#define ak4642_of_parse_mcko(d) 0
 #endif
 
-static const struct of_device_id ak4642_of_match[];
-static const struct i2c_device_id ak4642_i2c_id[];
 static int ak4642_i2c_probe(struct i2c_client *i2c)
 {
        struct device *dev = &i2c->dev;
-       const struct ak4642_drvdata *drvdata = NULL;
+       const struct ak4642_drvdata *drvdata;
        struct regmap *regmap;
        struct ak4642_priv *priv;
        struct clk *mcko = NULL;
 
        if (dev_fwnode(dev)) {
-               const struct of_device_id *of_id;
-
                mcko = ak4642_of_parse_mcko(dev);
                if (IS_ERR(mcko))
                        mcko = NULL;
-
-               of_id = of_match_device(ak4642_of_match, dev);
-               if (of_id)
-                       drvdata = of_id->data;
-       } else {
-               const struct i2c_device_id *id =
-                       i2c_match_id(ak4642_i2c_id, i2c);
-               drvdata = (const struct ak4642_drvdata *)id->driver_data;
        }
 
+       drvdata = i2c_get_match_data(i2c);
        if (!drvdata)
                return dev_err_probe(dev, -EINVAL, "Unknown device type\n");