[patch] modified scsi_register

Marcelo Tosatti (marcelo@conectiva.com.br)
Fri, 25 Jun 1999 17:50:08 -0300 (EST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--8323328-1688134032-930343808=:3584
Content-Type: TEXT/PLAIN; charset=US-ASCII

This patches modifies scsi_register to checkfor/return error codes.
The only driver modified is BusLogic (which i used for testing), but if
everything is fine, i'll change all SCSI drivers.
This + DMA thingy patch should fix most of scsi (current) oopses.

- Marcelo

--8323328-1688134032-930343808=:3584
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="scsi-reg.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.9906251750080.3584@freak.conectiva>
Content-Description:
Content-Disposition: attachment; filename="scsi-reg.patch"

ZGlmZiAtTnVyIGxpbnV4Lm9yaWcvZHJpdmVycy9zY3NpL0J1c0xvZ2ljLmMg
bGludXgvZHJpdmVycy9zY3NpL0J1c0xvZ2ljLmMNCi0tLSBsaW51eC5vcmln
L2RyaXZlcnMvc2NzaS9CdXNMb2dpYy5jCVdlZCBKdW4gMjMgMTA6NDY6NTcg
MTk5OQ0KKysrIGxpbnV4L2RyaXZlcnMvc2NzaS9CdXNMb2dpYy5jCVdlZCBK
dW4gMjMgMTM6MjA6NTggMTk5OQ0KQEAgLTI3OTcsNyArMjc5Nyw3IEBADQog
ICAgICAgLyoNCiAJUmVnaXN0ZXIgdGhlIFNDU0kgSG9zdCBzdHJ1Y3R1cmUu
DQogICAgICAgKi8NCi0gICAgICBIb3N0ID0gc2NzaV9yZWdpc3RlcihIb3N0
VGVtcGxhdGUsIHNpemVvZihCdXNMb2dpY19Ib3N0QWRhcHRlcl9UKSk7DQor
ICAgICAgc2NzaV9yZWdpc3RlcihIb3N0VGVtcGxhdGUsIHNpemVvZihCdXNM
b2dpY19Ib3N0QWRhcHRlcl9UKSwgJkhvc3QpOw0KICAgICAgIEhvc3RBZGFw
dGVyID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XIu
ICBXZQ0KIAkgICAgICogIGNhbiBkbyB0aGlzIG5vdy4NCiAJICAgICAqLw0K
LQkgICAgc2NzaV9yZWdpc3Rlcih0cG50LDApOw0KKwkgICAgc2NzaV9yZWdp
c3Rlcih0cG50LCAwLCAmaG9zdCk7DQogCX0NCiAJdHBudC0+bmV4dCA9IHNj
c2lfaG9zdHM7IC8qIEFkZCB0byB0aGUgbGlua2VkIGxpc3QgKi8NCiAJc2Nz
aV9ob3N0cyA9IHRwbnQ7DQo=
--8323328-1688134032-930343808=:3584--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/