@@ -696,20 +696,6 @@ static int axiadc_write_raw(struct iio_dev *indio_dev,
696696 }
697697}
698698
699- static int axiadc_read_label (struct iio_dev * indio_dev ,
700- const struct iio_chan_spec * chan , char * label )
701- {
702- struct axiadc_state * st = iio_priv (indio_dev );
703- struct axiadc_converter * conv = to_converter (st -> dev_spi );
704-
705- if (conv && conv -> read_label )
706- return conv -> read_label (indio_dev , chan , label );
707- else if (chan -> extend_name )
708- return sprintf (label , "%s\n" , chan -> extend_name );
709- else
710- return - ENOSYS ;
711- }
712-
713699static int axiadc_read_event_value (struct iio_dev * indio_dev ,
714700 const struct iio_chan_spec * chan , enum iio_event_type type ,
715701 enum iio_event_direction dir , enum iio_event_info info , int * val ,
@@ -842,7 +828,7 @@ static int axiadc_channel_setup(struct iio_dev *indio_dev,
842828 return 0 ;
843829}
844830
845- static const struct iio_info axiadc_info = {
831+ static struct iio_info axiadc_info = {
846832 .read_raw = & axiadc_read_raw ,
847833 .write_raw = & axiadc_write_raw ,
848834 .read_event_value = & axiadc_read_event_value ,
@@ -851,7 +837,6 @@ static const struct iio_info axiadc_info = {
851837 .write_event_config = & axiadc_write_event_config ,
852838 .debugfs_reg_access = & axiadc_reg_access ,
853839 .update_scan_mode = & axiadc_update_scan_mode ,
854- .read_label = & axiadc_read_label ,
855840};
856841
857842struct axiadc_spidev {
@@ -1204,6 +1189,8 @@ static int axiadc_probe(struct platform_device *pdev)
12041189 axiadc_channel_setup (indio_dev , conv -> chip_info -> channel ,
12051190 st -> dp_disable ? 0 : conv -> chip_info -> num_channels );
12061191
1192+ /* only have labels if really supported */
1193+ axiadc_info .read_label = conv -> read_label ;
12071194 st -> iio_info = axiadc_info ;
12081195 st -> iio_info .attrs = conv -> attrs ;
12091196 indio_dev -> info = & st -> iio_info ;
0 commit comments