mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
spi: octeon: Remove my_master pointer from struct octeon_spi
Pass master to platform_set_drvdata() then we can remove my_master pointer. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
c095ba7224
commit
e1b18ea809
1 changed files with 4 additions and 6 deletions
|
@ -28,7 +28,6 @@
|
|||
#define OCTEON_SPI_MAX_CLOCK_HZ 16000000
|
||||
|
||||
struct octeon_spi {
|
||||
struct spi_master *my_master;
|
||||
u64 register_base;
|
||||
u64 last_cfg;
|
||||
u64 cs_enax;
|
||||
|
@ -268,7 +267,6 @@ static int octeon_spi_nop_transfer_hardware(struct spi_master *master)
|
|||
|
||||
static int octeon_spi_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
||||
struct resource *res_mem;
|
||||
struct spi_master *master;
|
||||
struct octeon_spi *p;
|
||||
|
@ -278,8 +276,7 @@ static int octeon_spi_probe(struct platform_device *pdev)
|
|||
if (!master)
|
||||
return -ENOMEM;
|
||||
p = spi_master_get_devdata(master);
|
||||
platform_set_drvdata(pdev, p);
|
||||
p->my_master = master;
|
||||
platform_set_drvdata(pdev, master);
|
||||
|
||||
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
||||
|
@ -328,10 +325,11 @@ static int octeon_spi_probe(struct platform_device *pdev)
|
|||
|
||||
static int octeon_spi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct octeon_spi *p = platform_get_drvdata(pdev);
|
||||
struct spi_master *master = platform_get_drvdata(pdev);
|
||||
struct octeon_spi *p = spi_master_get_devdata(master);
|
||||
u64 register_base = p->register_base;
|
||||
|
||||
spi_unregister_master(p->my_master);
|
||||
spi_unregister_master(master);
|
||||
|
||||
/* Clear the CSENA* and put everything in a known state. */
|
||||
cvmx_write_csr(register_base + OCTEON_SPI_CFG, 0);
|
||||
|
|
Loading…
Reference in a new issue