From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, support@moxa.com.tw
Subject: Re: [PATCH 3/4] Char: mxser_new, pci_request_region for pci regions
Date: Thu, 5 Oct 2006 07:27:07 +0200 [thread overview]
Message-ID: <200610050727.17921.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <4523DB59.7020600@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2959 bytes --]
Jiri Slaby wrote:
> Rolf Eike Beer wrote:
> > Jiri Slaby wrote:
> >> mxser_new, pci_request_region for pci regions
> >>
> >> Use pci_request_region instead of standard request_region for pci device
> >> regions. More checking, simplier use.
> >>
> >> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> >>
> >> ---
> >> commit 1a717bdb06cef859dfbd426f46ea24a9c740e5c5
> >> tree 85460f01008e9fa2edea675a73b394c48139df4a
> >> parent d4f99406c592fb7ce2a65645d7c1f98ebe599238
> >> author Jiri Slaby <jirislaby@gmail.com> Sat, 30 Sep 2006 01:20:12 +0200
> >> committer Jiri Slaby <xslaby@anemoi.localdomain> Sat, 30 Sep 2006
> >> 01:20:12 +0200
> >>
> >> drivers/char/mxser_new.c | 10 ++++------
> >> 1 files changed, 4 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
> >> index dfef9ce..c566cd0 100644
> >> --- a/drivers/char/mxser_new.c
> >> +++ b/drivers/char/mxser_new.c
> >> @@ -526,8 +526,8 @@ static void __exit mxser_module_exit(voi
> >> pdev = mxser_boards[i].pdev;
> >> free_irq(mxser_boards[i].irq, &mxser_boards[i]);
> >> if (pdev != NULL) { /* PCI */
> >> - release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev,
> >> 2)); - release_region(pci_resource_start(pdev, 3),
> >> pci_resource_len(pdev, 3)); + pci_release_region(pdev, 2);
> >> + pci_release_region(pdev, 3);
> >> pci_dev_put(pdev);
> >> } else {
> >> release_region(mxser_boards[i].ports[0].ioaddr, 8 *
> >> mxser_boards[i].nports);
> >> @@ -627,16 +627,14 @@ static int __init
> >> mxser_get_PCI_conf(int
> >> brd->board_type = board_type;
> >> brd->nports = mxser_numports[board_type - 1];
> >> ioaddress = pci_resource_start(pdev, 2);
> >> - request_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2),
> >> - "mxser(IO)");
> >> + pci_request_region(pdev, 2, "mxser(IO)");
> >>
> >> for (i = 0; i < brd->nports; i++)
> >> brd->ports[i].ioaddr = ioaddress + 8 * i;
> >>
> >> /* vector */
> >> ioaddress = pci_resource_start(pdev, 3);
> >> - request_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3),
> >> - "mxser(vector)");
> >> + pci_request_region(pdev, 3, "mxser(vector)");
> >> brd->vector = ioaddress;
> >>
> >> /* irq */
> >
> > Correct me if I'm wrong, but that use of ioaddress looks totally wrong to
> > me. Isn't there a pci_iomap() or something missing?
>
> Both brd->vector and brd->ports[i].ioaddr are used in inb and outb function
> calls. They themselves remap a small range (one byte in these cases) and
> require ulong addresses as a parameter, not pointer to virtual space,
> correct?
Possible. I try to ignore that interface completely :) I would feel much more
comfortable if this would be done the other way. But this would probably
introduce more code because this one seems to work on non-PCI devices also.
So just ignore me :)
Eike
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2006-10-05 5:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-30 22:34 [PATCH 3/4] Char: mxser_new, pci_request_region for pci regions Jiri Slaby
2006-10-04 13:45 ` Rolf Eike Beer
2006-10-04 16:03 ` Jiri Slaby
2006-10-05 5:27 ` Rolf Eike Beer [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=200610050727.17921.eike-kernel@sf-tec.de \
--to=eike-kernel@sf-tec.de \
--cc=akpm@osdl.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=support@moxa.com.tw \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox