Skip to content

Commit 72a3aef

Browse files
André Apitzschgregkh
authored andcommitted
iio: magnetometer: ak8975: Fix 'Unexpected device' error
commit 848f68c upstream. Explicity specify array indices to fix mapping between asahi_compass_chipset and ak_def_array. While at it, remove unneeded AKXXXX. Fixes: 4f9ea93 ("iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables") Signed-off-by: André Apitzsch <git@apitzsch.eu> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231001-ak_magnetometer-v1-1-09bf3b8798a3@apitzsch.eu Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 18b5ee7 commit 72a3aef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/iio/magnetometer/ak8975.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ static long ak09912_raw_to_gauss(u16 data)
204204

205205
/* Compatible Asahi Kasei Compass parts */
206206
enum asahi_compass_chipset {
207-
AKXXXX = 0,
208207
AK8975,
209208
AK8963,
210209
AK09911,
@@ -248,7 +247,7 @@ struct ak_def {
248247
};
249248

250249
static const struct ak_def ak_def_array[] = {
251-
{
250+
[AK8975] = {
252251
.type = AK8975,
253252
.raw_to_gauss = ak8975_raw_to_gauss,
254253
.range = 4096,
@@ -273,7 +272,7 @@ static const struct ak_def ak_def_array[] = {
273272
AK8975_REG_HYL,
274273
AK8975_REG_HZL},
275274
},
276-
{
275+
[AK8963] = {
277276
.type = AK8963,
278277
.raw_to_gauss = ak8963_09911_raw_to_gauss,
279278
.range = 8190,
@@ -298,7 +297,7 @@ static const struct ak_def ak_def_array[] = {
298297
AK8975_REG_HYL,
299298
AK8975_REG_HZL},
300299
},
301-
{
300+
[AK09911] = {
302301
.type = AK09911,
303302
.raw_to_gauss = ak8963_09911_raw_to_gauss,
304303
.range = 8192,
@@ -323,7 +322,7 @@ static const struct ak_def ak_def_array[] = {
323322
AK09912_REG_HYL,
324323
AK09912_REG_HZL},
325324
},
326-
{
325+
[AK09912] = {
327326
.type = AK09912,
328327
.raw_to_gauss = ak09912_raw_to_gauss,
329328
.range = 32752,
@@ -348,7 +347,7 @@ static const struct ak_def ak_def_array[] = {
348347
AK09912_REG_HYL,
349348
AK09912_REG_HZL},
350349
},
351-
{
350+
[AK09916] = {
352351
.type = AK09916,
353352
.raw_to_gauss = ak09912_raw_to_gauss,
354353
.range = 32752,

0 commit comments

Comments
 (0)