[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070307133326.fcf6f891.akpm@linux-foundation.org>
Date: Wed, 7 Mar 2007 13:33:26 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Alex Williamson <alex.williamson@...com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Marcel Selhorst <tpm@...horst.net>,
Kylene Jo Hall <kjhall@...ibm.com>
Subject: Re: [PATCH] tpm_infineon: add support for devices in mmio space
On Wed, 07 Mar 2007 10:58:10 -0700
Alex Williamson <alex.williamson@...com> wrote:
> dev->name, dev_id->id);
> - if (!((TPM_INF_BASE >> 8) & 0xff)) {
> + if (!((tpm_dev.data_regs >> 8) & 0xff)) {
> rc = -EINVAL;
> goto err_last;
> }
> /* publish my base address and request region */
> - if (request_region
> - (TPM_INF_BASE, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {
> + if (request_region(tpm_dev.data_regs, tpm_dev.data_size,
> + "tpm_infineon0") == NULL) {
> rc = -EINVAL;
> goto err_last;
> }
> - if (request_region
> - (TPM_INF_ADDR, TPM_INF_ADDR_LEN, "tpm_infineon0") == NULL) {
> + if (request_region(tpm_dev.config_port, tpm_dev.config_size,
> + "tpm_infineon0") == NULL) {
> rc = -EINVAL;
> goto err_last;
> }
> + } else if (pnp_mem_valid(dev, 0) &&
> + !(pnp_mem_flags(dev, 0) & IORESOURCE_DISABLED)) {
> +
> + tpm_dev.iotype = TPM_INF_IO_MEM;
> +
> + tpm_dev.map_base = pnp_mem_start(dev, 0);
> + tpm_dev.map_size = pnp_mem_len(dev, 0);
> +
> + dev_info(&dev->dev, "Found %s with ID %s\n",
> + dev->name, dev_id->id);
> +
> + /* publish my base address and request region */
> + if (request_mem_region(tpm_dev.map_base, tpm_dev.map_size,
> + "tpm_infineon0") == NULL) {
> + rc = -EINVAL;
> + goto err_last;
> + }
> +
> + tpm_dev.mem_base = ioremap(tpm_dev.map_base, tpm_dev.map_size);
> + if (tpm_dev.mem_base == NULL) {
> + rc = -EINVAL;
> + goto err_last;
> + }
>
> ...
>
> err_last:
> return rc;
> }
tpm_inf_pnp_probe() leaks resources all over the place if something goes
wrong.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists