Linux-RTC Archive on lore.kernel.org
 help / Atom feed
From: Esben Haabendal <esben@haabendal.dk>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Lee Jones <lee.jones@linaro.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, netdev@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 2/4] mfd: ioc3: Add driver for SGI IOC3 chip
Date: Tue, 14 May 2019 14:39:25 +0200
Message-ID: <87mujpky6a.fsf@haabendal.dk> (raw)
In-Reply-To: <20190508102313.GG3995@dell>

On Tue, 09 Apr 2019, Thomas Bogendoerfer wrote:
> 
> diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
> index 358e66b81926..21fe722ebcd8 100644
> --- a/drivers/net/ethernet/sgi/ioc3-eth.c
> +++ b/drivers/net/ethernet/sgi/ioc3-eth.c
>  
>  [ ... ]
>  
> -	err = pci_request_regions(pdev, "ioc3");

Why are you dropping the call to pci_request_regions()?  Shouldn't you
do something similar in the new mfd driver?

When you are use the the BAR 0 resource as mem_base argument to
mfd_add_devices() later on, it will be split into child resources for
the child devices, but they will not be related to the IORESOURCE_MEM
root tree (iomem_resource) anymore.  I don't think that is how it is
supposed to be done, as it will allow random other drivers to request
the exact same memory area.

How/where is the memory resources inserted in the root IORESOURCE_MEM
resource (iomem_resource)?  Or is it allowed to use resources without
inserting it into the root tree?

> +	SET_NETDEV_DEV(dev, &pdev->dev);
> +	ip = netdev_priv(dev);
> +	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	ip->regs = ioremap(r->start, resource_size(r));
> +	r = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> +	ip->ssram = ioremap(r->start, resource_size(r));

Maybe use devm_platform_ioremap_resource() instead, which handles both
platform_get_resource() and ioremap() in one call..

/Esben

      parent reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 15:46 [PATCH v2 0/4] Use MFD framework for SGI IOC3 drivers Thomas Bogendoerfer
2019-04-09 15:46 ` [PATCH v2 1/4] MIPS: SGI-IP27: remove ioc3 ethernet init Thomas Bogendoerfer
2019-04-09 15:46 ` [PATCH v2 3/4] MIPS: SGI-IP27: fix readb/writeb addressing Thomas Bogendoerfer
2019-04-11 21:17   ` Alexandre Belloni
2019-04-09 15:46 ` [PATCH v2 4/4] Input: add IOC3 serio driver Thomas Bogendoerfer
     [not found] ` <20190409154610.6735-3-tbogendoerfer@suse.de>
2019-04-16 13:16   ` [PATCH v2 2/4] mfd: ioc3: Add driver for SGI IOC3 chip Greg Kroah-Hartman
2019-05-08 10:23   ` Lee Jones
2019-05-09 14:02     ` Thomas Bogendoerfer
2019-05-10  7:14       ` Lee Jones
2019-05-14 14:29         ` Thomas Bogendoerfer
2019-05-14 12:39     ` Esben Haabendal [this message]

Reply instructions:

You may reply publically 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=87mujpky6a.fsf@haabendal.dk \
    --to=esben@haabendal.dk \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhogan@kernel.org \
    --cc=jslaby@suse.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=tbogendoerfer@suse.de \
    /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

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org linux-rtc@archiver.kernel.org
	public-inbox-index linux-rtc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox