i3c: master: Make i3c_master_add_i3c_dev_locked() return void

The return value of i3c_master_add_i3c_dev_locked() is not used by any
caller, and callers are not in a position to recover from failures in
this path.

Change the function to return void.  Amend the kernel-doc accordingly,
fix some grammar and remove a stale paragraph.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260612080107.11606-6-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Adrian Hunter 2026-06-12 11:01:05 +03:00 committed by Alexandre Belloni
parent c236563c8a
commit 689d0bd8f4
2 changed files with 5 additions and 15 deletions

View File

@ -2324,19 +2324,12 @@ i3c_master_search_i3c_dev_duplicate(struct i3c_dev_desc *refdev)
* @master: master used to send frames on the bus
* @addr: I3C slave dynamic address assigned to the device
*
* This function is instantiating an I3C device object and adding it to the
* I3C device list. All device information are automatically retrieved using
* standard CCC commands.
*
* The I3C device object is returned in case the master wants to attach
* private data to it using i3c_dev_set_master_data().
* This function instantiates an I3C device object and adds it to the I3C device
* list. All device information is retrieved using standard CCC commands.
*
* This function must be called with the bus lock held in write mode.
*
* Return: a 0 in case of success, an negative error code otherwise.
*/
int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
u8 addr)
void i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, u8 addr)
{
struct i3c_device_info info = { .dyn_addr = addr };
struct i3c_dev_desc *newdev, *olddev;
@ -2460,7 +2453,7 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
mutex_unlock(&newdev->ibi_lock);
}
return 0;
return;
err_detach_dev:
if (newdev->dev && newdev->dev->desc)
@ -2480,8 +2473,6 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
i3c_bus_set_addr_slot_status(&master->bus, addr, I3C_ADDR_SLOT_I3C_DEV);
dev_err(&master->dev, "Failed to add I3C device at address %u, error %d\n", addr, ret);
return ret;
}
EXPORT_SYMBOL_GPL(i3c_master_add_i3c_dev_locked);

View File

@ -615,8 +615,7 @@ int i3c_master_defslvs_locked(struct i3c_master_controller *master);
int i3c_master_get_free_addr(struct i3c_master_controller *master,
u8 start_addr);
int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
u8 addr);
void i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, u8 addr);
int i3c_master_do_daa(struct i3c_master_controller *master);
int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa);
struct i3c_dma *i3c_master_dma_map_single(struct device *dev, void *ptr,