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

Configure Feed

Select the types of activity you want to include in your feed.

iio: proximity: vcnl3020: pass struct vcnl3020_property by pointer

Pass struct vcnl3020_property by pointer instead of by value to avoid
copying the entire struct.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250628-iio-const-data-25-v1-1-5d99cf17790e@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
96337ede 5b322dc4

+7 -7
+7 -7
drivers/iio/proximity/vcnl3020.c
··· 109 109 }; 110 110 111 111 static int vcnl3020_get_and_apply_property(struct vcnl3020_data *data, 112 - struct vcnl3020_property prop) 112 + struct vcnl3020_property *prop) 113 113 { 114 114 int rc; 115 115 u32 val; 116 116 117 - rc = device_property_read_u32(data->dev, prop.name, &val); 117 + rc = device_property_read_u32(data->dev, prop->name, &val); 118 118 if (rc) 119 119 return 0; 120 120 121 - if (prop.conversion_func) 122 - prop.conversion_func(&val); 121 + if (prop->conversion_func) 122 + prop->conversion_func(&val); 123 123 124 - rc = regmap_write(data->regmap, prop.reg, val); 124 + rc = regmap_write(data->regmap, prop->reg, val); 125 125 if (rc) { 126 126 dev_err(data->dev, "Error (%d) setting property (%s)\n", 127 - rc, prop.name); 127 + rc, prop->name); 128 128 } 129 129 130 130 return rc; ··· 153 153 mutex_init(&data->lock); 154 154 155 155 return vcnl3020_get_and_apply_property(data, 156 - vcnl3020_led_current_property); 156 + &vcnl3020_led_current_property); 157 157 }; 158 158 159 159 static bool vcnl3020_is_in_periodic_mode(struct vcnl3020_data *data)