Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2145717ybz; Thu, 23 Apr 2020 12:24:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLN3guODteHx9FITnzlU6TzSh3OSea+RhKPmUZUJl5973JTkVv1gNio3fedbRHOP5MMyc5+ X-Received: by 2002:a50:9e2a:: with SMTP id z39mr4337935ede.178.1587669844131; Thu, 23 Apr 2020 12:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587669844; cv=none; d=google.com; s=arc-20160816; b=sX5h81PqmI/kKcCTrlgZtl0g7cXSLh6XhbH12nECj74GueTLKcTAE3Y7eF59MusZ9i g3OmLnnIumMxn6UEemeEsw+4bc26SmE5aawMGRpWuqi/p9UCiajufTaRLQli0yKHW857 VPWOqoInkT1Z9KdJPzOnFjHfHUGarRDeVLALRSxz4g1Q7YJrGSsopWT2oNDt/vQxqIEH OA/xxGiC23D9KmB+yNYJjJfSt0/Onwht+RZxX+/GKhxDnaayXzhTwmfe4rEG2aD/v8at +6gmGgbryhq2GUHb6Ph7T082HYLnIZccytkKuHQv0LeIq0gMy6T+F+OC+r1NH53co0mZ EtGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YHcF20Pivw8z3/ND3mH4iQQaNlvKu4UnK2vOPdbQVJA=; b=FfDRj+XUWIRWToC6nB9wbR27SATPH92GLvf6IysBoN5lI5RkpGL6i+T9nYS9MZFUSZ 8Vfz1HnPhbW1K6qO1fcqqBijgJmYfc2xp6glp0MgHbHWdiTCEqT98XyrNySmUfJXrV3a w3QqILM88NWExqPl1c2h+W31IbIiy+c8MBPnXkcDnMeTOKXtullczjR5iTz+4NYnoT9G 5vRAvrau6O9l8BNgoubQK0l/DnMflE0Owln5h4b35TXChWkv+mye+7N/UYAtsERiB/x8 UzQZ+yW4YjUrmkUdDaPHFvCmtff6EOP8h7qFZf8PqTo5/18rzC0UoRDqvQaC4vTE6zSh VzQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FfBGHPK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si1790036edg.149.2020.04.23.12.23.40; Thu, 23 Apr 2020 12:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FfBGHPK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728959AbgDWPF0 (ORCPT + 99 others); Thu, 23 Apr 2020 11:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728551AbgDWPF0 (ORCPT ); Thu, 23 Apr 2020 11:05:26 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09202C08E934; Thu, 23 Apr 2020 08:05:26 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g6so3014917pgs.9; Thu, 23 Apr 2020 08:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YHcF20Pivw8z3/ND3mH4iQQaNlvKu4UnK2vOPdbQVJA=; b=FfBGHPK7wd3f4BANvXku7COH9+t7ONn4xwNP0pCwrDxGoSAjfB+kx+Ba2EjlFV+MQx 6JOKBdD69hIcNz+Lx0mdmGb4L7e8Z3Rq71Pmu08iUZaKD09/qI2P1Ufw4/8/ycV6U4VO PYJdNt4VGItxq7kJAlDRpz8DxoOvOjDhWktDup3jVleZ4Tocp5zsDz+ATnQEvpnMPrFv 6UEd4Uu0xASl247ScxZsDPwy0zvKJ5ofx0Kry678mnDgEpnZIyVvLHVS+0I1TJnXgyd4 CoHNMAjjymhKxRZJCFoGWt0v/1M/GTR7iKdgHZ4H2MWSIDwfojhh/OEdjCh/55XlfHZZ iOaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YHcF20Pivw8z3/ND3mH4iQQaNlvKu4UnK2vOPdbQVJA=; b=U7y9lY6dEOi34YPEJ868aDV5mWj7UhGs61gepVITmSXMHy2YGowgHkLVAnN1aLRf5I 2Ag5Bt9PGPJ8T5Ek3XDJiZG6Z0uSgXbEFaUzDpscB/jxw3SGNe/xACG3eQaLYxp4M+QY Sz1vP+F2pNEDNYmQva6fnzXEHDaRVPN8F+PhAmnPD8QZvtLycS7dKPxXlviMTd6dzO+g r/yMIfuuDJiJJYV+LQQ/SBldGqI0+uHidDLq+Tzzg/VZOSBTf0eY9MsEaA+AaxXn8DIi RF2H1QzVG1hlR7gJuAwo/H0zXdPkagRc0OLoeZ13AzSCnngr+cOlpiMVmbWi/Q8tKMLm 1S6w== X-Gm-Message-State: AGi0PuayJ2KkNkQ4aufo/sdqUgJ4VCRPf8b754WzmfrJMq9us+FdKNmD l4nEmvfxym7ta64tXvJcogLP8ROwyAcXTsmFez0= X-Received: by 2002:a63:5511:: with SMTP id j17mr4281090pgb.4.1587654325529; Thu, 23 Apr 2020 08:05:25 -0700 (PDT) MIME-Version: 1.0 References: <20200423142627.1820-1-zhengdejin5@gmail.com> <081f8192-1708-80ff-6eef-885d72bdf5c5@samsung.com> In-Reply-To: <081f8192-1708-80ff-6eef-885d72bdf5c5@samsung.com> From: Andy Shevchenko Date: Thu, 23 Apr 2020 18:05:18 +0300 Message-ID: Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe() To: Bartlomiej Zolnierkiewicz Cc: Dejin Zheng , Greg Kroah-Hartman , Thomas Gleixner , FlorianSchandinat@gmx.de, Ralf Baechle , Thomas Bogendoerfer , dri-devel , linux-fbdev@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 23, 2020 at 5:55 PM Bartlomiej Zolnierkiewicz 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