Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: xilinx-ams: Convert to use fwnode_device_is_compatible()

Replace open coded fwnode_device_is_compatible() in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20230119174749.76769-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
cd19fbfe c44e031b

+3 -6
+3 -6
drivers/iio/adc/xilinx-ams.c
··· 1220 1220 int num_channels = 0; 1221 1221 int ret; 1222 1222 1223 - if (fwnode_property_match_string(fwnode, "compatible", 1224 - "xlnx,zynqmp-ams-ps") == 0) { 1223 + if (fwnode_device_is_compatible(fwnode, "xlnx,zynqmp-ams-ps")) { 1225 1224 ams->ps_base = fwnode_iomap(fwnode, 0); 1226 1225 if (!ams->ps_base) 1227 1226 return -ENXIO; ··· 1231 1232 /* add PS channels to iio device channels */ 1232 1233 memcpy(channels, ams_ps_channels, sizeof(ams_ps_channels)); 1233 1234 num_channels = ARRAY_SIZE(ams_ps_channels); 1234 - } else if (fwnode_property_match_string(fwnode, "compatible", 1235 - "xlnx,zynqmp-ams-pl") == 0) { 1235 + } else if (fwnode_device_is_compatible(fwnode, "xlnx,zynqmp-ams-pl")) { 1236 1236 ams->pl_base = fwnode_iomap(fwnode, 0); 1237 1237 if (!ams->pl_base) 1238 1238 return -ENXIO; ··· 1245 1247 num_channels += AMS_PL_MAX_FIXED_CHANNEL; 1246 1248 num_channels = ams_get_ext_chan(fwnode, channels, 1247 1249 num_channels); 1248 - } else if (fwnode_property_match_string(fwnode, "compatible", 1249 - "xlnx,zynqmp-ams") == 0) { 1250 + } else if (fwnode_device_is_compatible(fwnode, "xlnx,zynqmp-ams")) { 1250 1251 /* add AMS channels to iio device channels */ 1251 1252 memcpy(channels, ams_ctrl_channels, sizeof(ams_ctrl_channels)); 1252 1253 num_channels += ARRAY_SIZE(ams_ctrl_channels);