Skip to content

Commit e165fcc

Browse files
committed
Make a priv data read API for probed SPI device
Signed-off-by: GuEe-GUI <[email protected]>
1 parent b2e8300 commit e165fcc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/drivers/include/drivers/dev_spi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ rt_err_t rt_spi_driver_register(struct rt_spi_driver *driver);
313313
rt_err_t rt_spi_device_register(struct rt_spi_device *device);
314314

315315
#define RT_SPI_DRIVER_EXPORT(driver) RT_DRIVER_EXPORT(driver, spi, BUILIN)
316+
317+
rt_inline const void *rt_spi_device_id_data(struct rt_spi_device *device)
318+
{
319+
return device->id ? device->id->data : (device->ofw_id ? device->ofw_id->data : RT_NULL);
320+
}
316321
#endif /* RT_USING_DM */
317322

318323
/**

0 commit comments

Comments
 (0)