Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: i3c: cleanup const #87447

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions drivers/i3c/i3c_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ int i3c_sec_get_basic_info(const struct device *dev, uint8_t dynamic_addr, uint8
const struct i3c_driver_config *config = dev->config;
int ret;

*(const struct device **)&temp_desc.bus = dev;
temp_desc.bus = dev;
temp_desc.dynamic_addr = dynamic_addr;
temp_desc.bcr = bcr;
temp_desc.dcr = dcr;
/* attach it first with a temperary value so we can at least get the pid */
/* attach it first with a temporary value so we can at least get the pid */
ret = i3c_attach_i3c_device(&temp_desc);
if (ret != 0) {
return ret;
Expand All @@ -415,7 +415,7 @@ int i3c_sec_get_basic_info(const struct device *dev, uint8_t dynamic_addr, uint8
return ret;
}

*(uint64_t *)&id = sys_get_be48(getpid.pid);
id.pid = sys_get_be48(getpid.pid);

/* try to see if we already have a device statically allocated */
desc = i3c_dev_list_find(&config->dev_list, &id);
Expand All @@ -425,8 +425,8 @@ int i3c_sec_get_basic_info(const struct device *dev, uint8_t dynamic_addr, uint8
if (!desc) {
return -ENOMEM;
}
*(uint64_t *)&desc->pid = id.pid;
*(uint16_t *)&temp_desc.static_addr = (uint16_t)static_addr;
desc->pid = id.pid;
temp_desc.static_addr = (uint16_t)static_addr;
}
desc->dynamic_addr = dynamic_addr;
desc->bcr = bcr;
Expand Down Expand Up @@ -462,8 +462,8 @@ int i3c_sec_i2c_attach(const struct device *dev, uint8_t static_addr, uint8_t lv
return -ENOMEM;
}
*(const struct device **)&i2c_desc->bus = dev;
*(uint16_t *)&i2c_desc->addr = (uint16_t)static_addr;
*(uint8_t *)&i2c_desc->lvr = lvr;
i2c_desc->addr = (uint16_t)static_addr;
i2c_desc->lvr = lvr;
}

ret = i3c_attach_i2c_device(i2c_desc);
Expand Down
14 changes: 7 additions & 7 deletions include/zephyr/drivers/i3c.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ __subsystem struct i3c_driver_api {
*/
struct i3c_device_id {
/** Device Provisioned ID */
const uint64_t pid:48;
uint64_t pid:48;
};

/**
Expand Down Expand Up @@ -890,13 +890,13 @@ struct i3c_device_desc {
sys_snode_t node;

/** I3C bus to which this target device is attached */
const struct device * const bus;
const struct device *bus;

/** Device driver instance of the I3C device */
const struct device * const dev;
const struct device *dev;

/** Device Provisioned ID */
const uint64_t pid;
uint64_t pid;

/**
* Static address for this target device.
Expand All @@ -910,7 +910,7 @@ struct i3c_device_desc {
* device (as both are to tell target device to use static
* address as dynamic address).
*/
const uint8_t static_addr;
uint8_t static_addr;

/**
* Initial dynamic address.
Expand Down Expand Up @@ -1107,13 +1107,13 @@ struct i3c_i2c_device_desc {
const struct device *bus;

/** Static address for this I2C device. */
const uint16_t addr;
uint16_t addr;

/**
* Legacy Virtual Register (LVR)
* @see @ref I3C_LVR
*/
const uint8_t lvr;
uint8_t lvr;

/** @cond INTERNAL_HIDDEN */
/**
Expand Down
Loading