Repository navigation
Commit a17cb78
iio: move 'indio_dev->info' null check first in __iio_device_register()
Moves this to be the first check, as it's very simple and fails the
registration earlier, instead of potentially initializing the
'indio_dev->label' and checking for duplicate indexes, and then failing
with this simple-check.
This is a minor optimization, since '__iio_device_register()' will waste
fewer validation cycles in case 'indio_dev->info' is NULL.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>1 parent 2e03680 commit a17cb78
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
1714 | 1717 | | |
1715 | 1718 | | |
1716 | 1719 | | |
| |||
1723 | 1726 | | |
1724 | 1727 | | |
1725 | 1728 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | 1729 | | |
1730 | 1730 | | |
1731 | 1731 | | |
| |||
0 commit comments