Revert "spi: introduce new helpers with using modern naming"

This reverts commit 1a8183ccf0 which is
commit b8d3b056a7 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I06189e6aba9530c83c5248dbbc4015736bdfd2d5
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-07-22 09:59:06 +00:00
parent 6971d8bfbd
commit 0bf7f66897
2 changed files with 2 additions and 56 deletions

View File

@@ -2774,17 +2774,6 @@ int spi_slave_abort(struct spi_device *spi)
} }
EXPORT_SYMBOL_GPL(spi_slave_abort); EXPORT_SYMBOL_GPL(spi_slave_abort);
int spi_target_abort(struct spi_device *spi)
{
struct spi_controller *ctlr = spi->controller;
if (spi_controller_is_target(ctlr) && ctlr->target_abort)
return ctlr->target_abort(ctlr);
return -ENOTSUPP;
}
EXPORT_SYMBOL_GPL(spi_target_abort);
static ssize_t slave_show(struct device *dev, struct device_attribute *attr, static ssize_t slave_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {

View File

@@ -382,7 +382,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
* @max_speed_hz: Highest supported transfer speed * @max_speed_hz: Highest supported transfer speed
* @flags: other constraints relevant to this driver * @flags: other constraints relevant to this driver
* @slave: indicates that this is an SPI slave controller * @slave: indicates that this is an SPI slave controller
* @target: indicates that this is an SPI target controller
* @devm_allocated: whether the allocation of this struct is devres-managed * @devm_allocated: whether the allocation of this struct is devres-managed
* @max_transfer_size: function that returns the max transfer size for * @max_transfer_size: function that returns the max transfer size for
* a &spi_device; may be %NULL, so the default %SIZE_MAX will be used. * a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
@@ -467,7 +466,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
* @mem_caps: controller capabilities for the handling of memory operations. * @mem_caps: controller capabilities for the handling of memory operations.
* @unprepare_message: undo any work done by prepare_message(). * @unprepare_message: undo any work done by prepare_message().
* @slave_abort: abort the ongoing transfer request on an SPI slave controller * @slave_abort: abort the ongoing transfer request on an SPI slave controller
* @target_abort: abort the ongoing transfer request on an SPI target controller
* @cs_gpiods: Array of GPIO descs to use as chip select lines; one per CS * @cs_gpiods: Array of GPIO descs to use as chip select lines; one per CS
* number. Any individual value may be NULL for CS lines that * number. Any individual value may be NULL for CS lines that
* are not GPIOs (driven by the SPI controller itself). * are not GPIOs (driven by the SPI controller itself).
@@ -564,12 +562,8 @@ struct spi_controller {
/* Flag indicating if the allocation of this struct is devres-managed */ /* Flag indicating if the allocation of this struct is devres-managed */
bool devm_allocated; bool devm_allocated;
union { /* Flag indicating this is an SPI slave controller */
/* Flag indicating this is an SPI slave controller */ bool slave;
bool slave;
/* Flag indicating this is an SPI target controller */
bool target;
};
/* /*
* on some hardware transfer / message size may be constrained * on some hardware transfer / message size may be constrained
@@ -683,7 +677,6 @@ struct spi_controller {
int (*unprepare_message)(struct spi_controller *ctlr, int (*unprepare_message)(struct spi_controller *ctlr,
struct spi_message *message); struct spi_message *message);
int (*slave_abort)(struct spi_controller *ctlr); int (*slave_abort)(struct spi_controller *ctlr);
int (*target_abort)(struct spi_controller *ctlr);
/* /*
* These hooks are for drivers that use a generic implementation * These hooks are for drivers that use a generic implementation
@@ -764,11 +757,6 @@ static inline bool spi_controller_is_slave(struct spi_controller *ctlr)
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->slave; return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->slave;
} }
static inline bool spi_controller_is_target(struct spi_controller *ctlr)
{
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->target;
}
/* PM calls that need to be issued by the driver */ /* PM calls that need to be issued by the driver */
extern int spi_controller_suspend(struct spi_controller *ctlr); extern int spi_controller_suspend(struct spi_controller *ctlr);
extern int spi_controller_resume(struct spi_controller *ctlr); extern int spi_controller_resume(struct spi_controller *ctlr);
@@ -805,21 +793,6 @@ static inline struct spi_controller *spi_alloc_slave(struct device *host,
return __spi_alloc_controller(host, size, true); return __spi_alloc_controller(host, size, true);
} }
static inline struct spi_controller *spi_alloc_host(struct device *dev,
unsigned int size)
{
return __spi_alloc_controller(dev, size, false);
}
static inline struct spi_controller *spi_alloc_target(struct device *dev,
unsigned int size)
{
if (!IS_ENABLED(CONFIG_SPI_SLAVE))
return NULL;
return __spi_alloc_controller(dev, size, true);
}
struct spi_controller *__devm_spi_alloc_controller(struct device *dev, struct spi_controller *__devm_spi_alloc_controller(struct device *dev,
unsigned int size, unsigned int size,
bool slave); bool slave);
@@ -839,21 +812,6 @@ static inline struct spi_controller *devm_spi_alloc_slave(struct device *dev,
return __devm_spi_alloc_controller(dev, size, true); return __devm_spi_alloc_controller(dev, size, true);
} }
static inline struct spi_controller *devm_spi_alloc_host(struct device *dev,
unsigned int size)
{
return __devm_spi_alloc_controller(dev, size, false);
}
static inline struct spi_controller *devm_spi_alloc_target(struct device *dev,
unsigned int size)
{
if (!IS_ENABLED(CONFIG_SPI_SLAVE))
return NULL;
return __devm_spi_alloc_controller(dev, size, true);
}
extern int spi_register_controller(struct spi_controller *ctlr); extern int spi_register_controller(struct spi_controller *ctlr);
extern int devm_spi_register_controller(struct device *dev, extern int devm_spi_register_controller(struct device *dev,
struct spi_controller *ctlr); struct spi_controller *ctlr);
@@ -1217,7 +1175,6 @@ static inline void spi_message_free(struct spi_message *m)
extern int spi_setup(struct spi_device *spi); extern int spi_setup(struct spi_device *spi);
extern int spi_async(struct spi_device *spi, struct spi_message *message); extern int spi_async(struct spi_device *spi, struct spi_message *message);
extern int spi_slave_abort(struct spi_device *spi); extern int spi_slave_abort(struct spi_device *spi);
extern int spi_target_abort(struct spi_device *spi);
static inline size_t static inline size_t
spi_max_message_size(struct spi_device *spi) spi_max_message_size(struct spi_device *spi)