Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57437561 authored by Jingoo Han's avatar Jingoo Han Committed by David S. Miller
Browse files

net: ethernet: enc28j60: use spi_get_drvdata() and spi_set_drvdata()



Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f996607
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1566,7 +1566,7 @@ static int enc28j60_probe(struct spi_device *spi)
	INIT_WORK(&priv->setrx_work, enc28j60_setrx_work_handler);
	INIT_WORK(&priv->setrx_work, enc28j60_setrx_work_handler);
	INIT_WORK(&priv->irq_work, enc28j60_irq_work_handler);
	INIT_WORK(&priv->irq_work, enc28j60_irq_work_handler);
	INIT_WORK(&priv->restart_work, enc28j60_restart_work_handler);
	INIT_WORK(&priv->restart_work, enc28j60_restart_work_handler);
	dev_set_drvdata(&spi->dev, priv);	/* spi to priv reference */
	spi_set_drvdata(spi, priv);	/* spi to priv reference */
	SET_NETDEV_DEV(dev, &spi->dev);
	SET_NETDEV_DEV(dev, &spi->dev);


	if (!enc28j60_chipset_init(dev)) {
	if (!enc28j60_chipset_init(dev)) {
@@ -1618,7 +1618,7 @@ static int enc28j60_probe(struct spi_device *spi)


static int enc28j60_remove(struct spi_device *spi)
static int enc28j60_remove(struct spi_device *spi)
{
{
	struct enc28j60_net *priv = dev_get_drvdata(&spi->dev);
	struct enc28j60_net *priv = spi_get_drvdata(spi);


	if (netif_msg_drv(priv))
	if (netif_msg_drv(priv))
		printk(KERN_DEBUG DRV_NAME ": remove\n");
		printk(KERN_DEBUG DRV_NAME ": remove\n");