[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd8kC6ub-=pwe3QtdZ=FBqka3F1bbHea6__G5_Vm_ybcQ@mail.gmail.com>
Date: Thu, 23 Apr 2020 18:05:18 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Cc: Dejin Zheng <zhengdejin5@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>, FlorianSchandinat@....de,
Ralf Baechle <ralf@...ux-mips.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
dri-devel <dri-devel@...ts.freedesktop.org>,
linux-fbdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
On Thu, Apr 23, 2020 at 5:55 PM Bartlomiej Zolnierkiewicz
<b.zolnierkie@...sung.com> wrote:
> > + if (err)
> > + iounmap((void *)npregs);
>
> Looks OK but while you are at it, could you please also add missing
> release_mem_region() on error and on device removal:
>
> newport_addr = dev->resource.start + 0xF0000;
> if (!request_mem_region(newport_addr, 0x10000, "Newport"))
> return -ENODEV;
>
> npregs = (struct newport_regs *)/* ioremap cannot fail */
> ioremap(newport_addr, sizeof(struct newport_regs));
> console_lock();
> err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> console_unlock();
> return err;
> }
>
> static void newport_remove(struct gio_device *dev)
> {
> give_up_console(&newport_con);
> iounmap((void *)npregs);
> }
>
> ?
Don't you think that proper solution is rather switch to memremap()?
> > return err;
> > }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists