linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix ibm ocp ifconfig oops (for real this time)
@ 2002-05-14 23:30 John Tyner
  2002-05-14 23:47 ` Armin
  0 siblings, 1 reply; 2+ messages in thread
From: John Tyner @ 2002-05-14 23:30 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1103 bytes --]

Here is a shorter patch that actually works. Please disregard my last one.

--- drivers/net/ibm_ocp/ibm_ocp_enet.c	Tue May 14 16:24:17 2002
+++ drivers/net/ibm_ocp/ibm_ocp_enet.c	Tue May 14 16:25:58 2002
@@ -244,14 +244,11 @@
 		fep = (struct fec_enet_private *) EMAC_DEV(ocpdev);
 		emacp = (emac_t *) EMAC_DEV(paddr);
 	} else {
-		if ((emac_driver =
-		     ocp_alloc_dev(sizeof (struct fec_enet_private))) == NULL)
-			return -ENOMEM;
+		emac_driver = ( struct ocp_driver *)dev->priv;
 		strcpy(emac_driver->name, "emac");
 		emac_driver->type = EMAC;
 		/* this returns the next emac number */
 		if ((emac_num = ocp_register(emac_driver)) >= 0) {
-			dev->priv = (void *) emac_driver;
 			emac_driver->priv_index = dev->ifindex;
 			emacp =
 			    (emac_t *) ((struct ocp_driver *) dev->priv)->paddr;
@@ -676,6 +673,10 @@
 		dev->set_multicast_list = &ppc405_enet_set_multicast_list;
 		dev->do_ioctl = &fec_enet_ioctl;
 		emac_dev[curr_emac] = dev;
+
+		if ((dev->priv =
+		     ocp_alloc_dev(sizeof (struct fec_enet_private))) == NULL)
+			return -ENOMEM;
 	}

 	for (i = 0; i < NMII - 1; i++)

[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 522 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix ibm ocp ifconfig oops (for real this time)
  2002-05-14 23:30 [PATCH] fix ibm ocp ifconfig oops (for real this time) John Tyner
@ 2002-05-14 23:47 ` Armin
  0 siblings, 0 replies; 2+ messages in thread
From: Armin @ 2002-05-14 23:47 UTC (permalink / raw)
  To: John Tyner; +Cc: linuxppc-embedded


John Tyner wrote:
> Here is a shorter patch that actually works. Please disregard my last one.
>
> --- drivers/net/ibm_ocp/ibm_ocp_enet.c	Tue May 14 16:24:17 2002
> +++ drivers/net/ibm_ocp/ibm_ocp_enet.c	Tue May 14 16:25:58 2002
> @@ -244,14 +244,11 @@
>  		fep = (struct fec_enet_private *) EMAC_DEV(ocpdev);
>  		emacp = (emac_t *) EMAC_DEV(paddr);
>  	} else {
> -		if ((emac_driver =
> -		     ocp_alloc_dev(sizeof (struct fec_enet_private))) == NULL)
> -			return -ENOMEM;
> +		emac_driver = ( struct ocp_driver *)dev->priv;
>  		strcpy(emac_driver->name, "emac");
>  		emac_driver->type = EMAC;
>  		/* this returns the next emac number */
>  		if ((emac_num = ocp_register(emac_driver)) >= 0) {
> -			dev->priv = (void *) emac_driver;
>  			emac_driver->priv_index = dev->ifindex;
>  			emacp =
>  			    (emac_t *) ((struct ocp_driver *) dev->priv)->paddr;
> @@ -676,6 +673,10 @@
>  		dev->set_multicast_list = &ppc405_enet_set_multicast_list;
>  		dev->do_ioctl = &fec_enet_ioctl;
>  		emac_dev[curr_emac] = dev;
> +
> +		if ((dev->priv =
> +		     ocp_alloc_dev(sizeof (struct fec_enet_private))) == NULL)
> +			return -ENOMEM;
>  	}
>
>  	for (i = 0; i < NMII - 1; i++)
>

Thanks,

armin


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-14 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-14 23:30 [PATCH] fix ibm ocp ifconfig oops (for real this time) John Tyner
2002-05-14 23:47 ` Armin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).