From: "Krzysztof Helt" <krzysztof.h1@wp.pl>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH] sunlance probing problem
Date: Fri, 18 Aug 2006 17:32:54 +0000 [thread overview]
Message-ID: <44e5f9c66eac3@wp.pl> (raw)
In-Reply-To: <44dcfea4406f9@wp.pl>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="part44e5f9c6711d9", Size: 45 bytes --]
This is a multi-part message in MIME format.
[-- Attachment #2: Type: text/plain, Size: 1057 bytes --]
Dnia 18-08-2006 o godz. 3:10 David Miller napisał(a):
> If you return "0" as the error, the caller in the device
probing layer
> grabs a reference to the device which will be a leak of the
undelying
> of_device object.
>
> A better way to fix this is probably to only match "le" and have
> the probe code check the device parent for "ledma" or "lebuffer".
> You should be able to confine all of your changes to the probe
> match table and sunlance_sbus_probe().
>
> Could you implement it like that and give it a test?
>
> Thanks.
>
This is a tested patch according to your sugestions (as far as
I understood them).
Regards,
Krzysztof
PS. Forget the previous patch. It is incorrect if "le" is standalone.
----------------------------------------------------
Najnowsze odkrycie światowej muzyki- smacznej i snobistycznej.
Wschodząca gwiazda, wybitnie utalentowana Sophie Solomon
wraz z zespołem w Warszawie!!
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fsophie_solomon_w_fabryce_trzciny.html&sid=846
[-- Attachment #3: lance-id.patch --]
[-- Type: application/octet-stream, Size: 1449 bytes --]
--- linux-2.6.17/drivers/net/sunlance.c 2006-08-10 08:23:30.000000000 +0200
+++ linux-2.6.17a/drivers/net/sunlance.c 2006-08-18 19:03:10.000000000 +0200
@@ -1566,20 +1566,21 @@ static int __exit sunlance_sun4_remove(v
static int __devinit sunlance_sbus_probe(struct of_device *dev, const struct of_device_id *match)
{
struct sbus_dev *sdev = to_sbus_device(&dev->dev);
- struct device_node *dp = dev->node;
int err;
- if (!strcmp(dp->name, "le")) {
- err = sparc_lance_probe_one(sdev, NULL, NULL);
- } else if (!strcmp(dp->name, "ledma")) {
- struct sbus_dma *ledma = find_ledma(sdev);
+ if (sdev->parent) {
+ struct of_device *parent = &sdev->parent->ofdev;
- err = sparc_lance_probe_one(sdev->child, ledma, NULL);
- } else {
- BUG_ON(strcmp(dp->name, "lebuffer"));
+ if (!strcmp(parent->node->name, "ledma")) {
+ struct sbus_dma *ledma = find_ledma(to_sbus_device(&parent->dev));
- err = sparc_lance_probe_one(sdev->child, NULL, sdev);
- }
+ err = sparc_lance_probe_one(sdev, ledma, NULL);
+ } else if (!strcmp(parent->node->name, "lebuffer")) {
+ err = sparc_lance_probe_one(sdev, NULL, to_sbus_device(&parent->dev));
+ } else
+ err = sparc_lance_probe_one(sdev, NULL, NULL);
+ } else
+ err = sparc_lance_probe_one(sdev, NULL, NULL);
return err;
}
@@ -1604,12 +1605,6 @@ static struct of_device_id sunlance_sbus
{
.name = "le",
},
- {
- .name = "ledma",
- },
- {
- .name = "lebuffer",
- },
{},
};
prev parent reply other threads:[~2006-08-18 17:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-11 22:03 [PATCH] sunlance probing problem Krzysztof Helt
2006-08-11 23:11 ` Eric Brower
2006-08-11 23:27 ` David Miller
2006-08-12 13:20 ` Krzysztof Helt
2006-08-18 1:10 ` David Miller
2006-08-18 17:32 ` Krzysztof Helt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44e5f9c66eac3@wp.pl \
--to=krzysztof.h1@wp.pl \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.