* @brief This function register a rt_driver to platform bus. * * @return the error code, RT_EOK on successfully. */
| 50 | * @return the error code, RT_EOK on successfully. |
| 51 | */ |
| 52 | rt_err_t rt_platform_driver_register(struct rt_platform_driver *pdrv) |
| 53 | { |
| 54 | RT_ASSERT(pdrv != RT_NULL); |
| 55 | |
| 56 | pdrv->parent.bus = &platform_bus; |
| 57 | #if RT_NAME_MAX > 0 |
| 58 | rt_strcpy(pdrv->parent.parent.name, pdrv->name); |
| 59 | #else |
| 60 | pdrv->parent.parent.name = pdrv->name; |
| 61 | #endif |
| 62 | return rt_driver_register(&pdrv->parent); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * @brief This function register a rt_device to platform bus. |
no test coverage detected