diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 9c5c9ef3f1dad25f37e108aeb9752940f46aa393..11059b2c39a413e27cc39790aed0aae243dc2cbf 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -774,8 +774,11 @@ static int ak8975_probe(struct i2c_client *client, if (id) { chipset = (enum asahi_compass_chipset)(id->driver_data); name = id->name; - } else if (ACPI_HANDLE(&client->dev)) + } else if (ACPI_HANDLE(&client->dev)) { name = ak8975_match_acpi_device(&client->dev, &chipset); + if (!name) + return -ENODEV; + } else return -ENOSYS;