| .. | .. |
|---|
| 67 | 67 | }; |
|---|
| 68 | 68 | |
|---|
| 69 | 69 | static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] = { |
|---|
| 70 | | - [INV_CHIP_ICM40608] = { |
|---|
| 71 | | - .whoami = INV_ICM42600_WHOAMI_ICM40608, |
|---|
| 72 | | - .name = "icm40608", |
|---|
| 73 | | - .conf = &inv_icm42600_default_conf, |
|---|
| 74 | | - }, |
|---|
| 75 | 70 | [INV_CHIP_ICM42600] = { |
|---|
| 76 | 71 | .whoami = INV_ICM42600_WHOAMI_ICM42600, |
|---|
| 77 | 72 | .name = "icm42600", |
|---|
| .. | .. |
|---|
| 95 | 90 | }; |
|---|
| 96 | 91 | |
|---|
| 97 | 92 | const struct iio_mount_matrix * |
|---|
| 98 | | -inv_icm42600_get_mount_matrix(struct iio_dev *indio_dev, |
|---|
| 93 | +inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev, |
|---|
| 99 | 94 | const struct iio_chan_spec *chan) |
|---|
| 100 | 95 | { |
|---|
| 101 | | - struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev); |
|---|
| 96 | + const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev); |
|---|
| 102 | 97 | |
|---|
| 103 | 98 | return &st->orientation; |
|---|
| 104 | 99 | } |
|---|
| .. | .. |
|---|
| 570 | 565 | bool open_drain; |
|---|
| 571 | 566 | int ret; |
|---|
| 572 | 567 | |
|---|
| 573 | | - if (chip < 0 || chip >= INV_CHIP_NB) { |
|---|
| 568 | + if (chip <= INV_CHIP_INVALID || chip >= INV_CHIP_NB) { |
|---|
| 574 | 569 | dev_err(dev, "invalid chip = %d\n", chip); |
|---|
| 575 | 570 | return -ENODEV; |
|---|
| 576 | 571 | } |
|---|
| .. | .. |
|---|
| 597 | 592 | st->chip = chip; |
|---|
| 598 | 593 | st->map = regmap; |
|---|
| 599 | 594 | |
|---|
| 600 | | - ret = of_iio_read_mount_matrix(dev, "mount-matrix", &st->orientation); |
|---|
| 595 | + ret = iio_read_mount_matrix(dev, "mount-matrix", &st->orientation); |
|---|
| 601 | 596 | if (ret) { |
|---|
| 602 | 597 | dev_err(dev, "failed to retrieve mounting matrix %d\n", ret); |
|---|
| 603 | 598 | return ret; |
|---|