History

i3c: master: cleanup callback .priv_xfers()

Remove the .priv_xfers() callback from the framework after all master controller drivers have switched to use the new .i3c_xfers() callback.

Frank Li committed 11 months ago

Commit 41b80d41 parent eaa08702 files · +4 −22Browse files

Unified · Split

2 files
  1. drivers/i3c/master.c +2 −12
  2. include/linux/i3c/master.h +2 −10
drivers/i3c/master.c+2−12
@@ -2819,14 +2819,10 @@ EXPORT_SYMBOL_GPL(i3c_generic_ibi_recycle_slot); · 2818 unmodified lines
2819 2819
2820static int i3c_master_check_ops(const struct i3c_master_controller_ops *ops)2820static int i3c_master_check_ops(const struct i3c_master_controller_ops *ops)
2821{2821{
2822 if (!ops || !ops->bus_init ||2822 if (!ops || !ops->bus_init || !ops->i3c_xfers ||
2823 !ops->send_ccc_cmd || !ops->do_daa || !ops->i2c_xfers)2823 !ops->send_ccc_cmd || !ops->do_daa || !ops->i2c_xfers)
2824 return -EINVAL;2824 return -EINVAL;
2825 2825
2826 /* Must provide one of priv_xfers (SDR only) or i3c_xfers (all modes) */
2827 if (!ops->priv_xfers && !ops->i3c_xfers)
2828 return -EINVAL;
2829
2830 if (ops->request_ibi &&2826 if (ops->request_ibi &&
2831 (!ops->enable_ibi || !ops->disable_ibi || !ops->free_ibi ||2827 (!ops->enable_ibi || !ops->disable_ibi || !ops->free_ibi ||
2832 !ops->recycle_ibi_slot))2828 !ops->recycle_ibi_slot))
@@ -3031,13 +3027,7 @@ int i3c_dev_do_xfers_locked(struct i3c_dev_desc *dev, struct i3c_xfer *xfers, · 198 unmodified lines
3031 if (mode != I3C_SDR && !(master->this->info.hdr_cap & BIT(mode)))3027 if (mode != I3C_SDR && !(master->this->info.hdr_cap & BIT(mode)))
3032 return -EOPNOTSUPP;3028 return -EOPNOTSUPP;
3033 3029
3034 if (master->ops->i3c_xfers)3030 return master->ops->i3c_xfers(dev, xfers, nxfers, mode);
3035 return master->ops->i3c_xfers(dev, xfers, nxfers, mode);
3036
3037 if (mode != I3C_SDR)
3038 return -EINVAL;
3039
3040 return master->ops->priv_xfers(dev, xfers, nxfers);
3041}3031}
3042 3032
3043int i3c_dev_disable_ibi_locked(struct i3c_dev_desc *dev)3033int i3c_dev_disable_ibi_locked(struct i3c_dev_desc *dev)
include/linux/i3c/master.h+2−10
@@ -417,12 +417,8 @@ struct i3c_bus { · 416 unmodified lines
417 * all CCC commands are supported.417 * all CCC commands are supported.
418 * @send_ccc_cmd: send a CCC command418 * @send_ccc_cmd: send a CCC command
419 * This method is mandatory.419 * This method is mandatory.
420 * @priv_xfers: do one or several private I3C SDR transfers420 * @i3c_xfers: do one or several I3C SDR or HDR transfers.
421 * This method is mandatory when i3c_xfers is not implemented. It421 * This method is mandatory.
422 * is deprecated.
423 * @i3c_xfers: do one or several I3C SDR or HDR transfers
424 * This method is mandatory when priv_xfers is not implemented but
425 * should be implemented instead of priv_xfers.
426 * @attach_i2c_dev: called every time an I2C device is attached to the bus.422 * @attach_i2c_dev: called every time an I2C device is attached to the bus.
427 * This is a good place to attach master controller specific423 * This is a good place to attach master controller specific
428 * data to I2C devices.424 * data to I2C devices.
@@ -478,10 +474,6 @@ struct i3c_master_controller_ops { · 49 unmodified lines
478 const struct i3c_ccc_cmd *cmd);474 const struct i3c_ccc_cmd *cmd);
479 int (*send_ccc_cmd)(struct i3c_master_controller *master,475 int (*send_ccc_cmd)(struct i3c_master_controller *master,
480 struct i3c_ccc_cmd *cmd);476 struct i3c_ccc_cmd *cmd);
481 /* Deprecated, please use i3c_xfers() */
482 int (*priv_xfers)(struct i3c_dev_desc *dev,
483 struct i3c_priv_xfer *xfers,
484 int nxfers);
485 int (*i3c_xfers)(struct i3c_dev_desc *dev,477 int (*i3c_xfers)(struct i3c_dev_desc *dev,
486 struct i3c_xfer *xfers,478 struct i3c_xfer *xfers,
487 int nxfers, enum i3c_xfer_mode mode);479 int nxfers, enum i3c_xfer_mode mode);