Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp25778ybl; Mon, 27 Jan 2020 21:19:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwtidHVAW74eF1yPs1MqC6DNhpChFYy6fsfEYXgqM2AzDro/z96DCh2PJ5BV6h0lh4qtEQR X-Received: by 2002:a9d:6c06:: with SMTP id f6mr15535454otq.318.1580188759155; Mon, 27 Jan 2020 21:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580188759; cv=none; d=google.com; s=arc-20160816; b=rfoRVFCdvMmYL31EIYfFOgroUKmbjEklG+6FjnLqtIkM+iTFVrIdmDkID1Mpecg54G OP4B/MCPT/1Ww+bdtEWfmR0x6k9EIzS59xmXvCfFcxeGNAqt4eZUzfb0MJSeraXJvDfK IdFvoCGxdzjTXNA9cPFYdPzaTX7wBfnzCbKPRwc27GErEa/TQpkJjrpUmB4bHMN/5hHg F88AxjZIE61RYMtO2faOaE79+zBss/BBDEOVdPgPpKJ147rkE5V9/dg8nAAd1YIBB2wO 4eQM7Bi7+oeFh8dZVGW/GOSw+w54LV4suMXnvEvnlLo5wMY2OvWRNbbuCm5AXPZDdwfe ez1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=otf+Kn6E7gyvAshKC+Kdl4WFFbgC+FHpC4JGC79vfSY=; b=UXonVoNnmq3ghIJvxNWtIjtLWoztWVauzgMlAhVh6din/LMa6So9BCXMGzbA71m0ht zvLk9bsjpQaSc/mNF7jIyW2xvQhwavHyo+2BLog4LRDgy4laME6aXc2By4ilcsM30WVn hugQ3Zv9PfEB2cNC1f75TN3akM68NszXfRP7AL4Id5AA7Cx6OedFeVg3YIznrs4jrirO Q7dDd8/9HUlP8gZqyWupaEfyYaaeFDGerBZoJXdK8JqwvXqo+u4A7vF8z4ipE1e8KWKG Rurf0YrquPF7NUsqeay7XR9pg2nUhxLPuZN2LH97labrhjaFPKZDtBHwxng1iLlZ5VRA 9qaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t58f8cjQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j74si3465180otj.246.2020.01.27.21.18.56; Mon, 27 Jan 2020 21:19:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t58f8cjQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1725810AbgA1FRP (ORCPT + 99 others); Tue, 28 Jan 2020 00:17:15 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40168 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgA1FRP (ORCPT ); Tue, 28 Jan 2020 00:17:15 -0500 Received: by mail-pg1-f194.google.com with SMTP id k25so6342559pgt.7 for ; Mon, 27 Jan 2020 21:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=otf+Kn6E7gyvAshKC+Kdl4WFFbgC+FHpC4JGC79vfSY=; b=t58f8cjQR2wG6rt1bbL+cDPFF77PanYskydWvDuxs14ZXbByeZDMu1K4RJBqP3xPuZ KdOi7J+3RBR7vomXkUojcWiMd7gENUIs5Lpl3QeE8iCXY/mQw0OICNKSGOOgZwTpSgFT 3JW+CVSqwW+lIl4yPl5tpY2vDcuRRZKHTQ7hNtykESa4AsfeJ7C1spEcgdFT2574quEA 1ZV6iv6Iu3xJtdnoU+DljeYDar37k5p+woCwSbNxvCpbwKJLJalJuPFgtk5/BA5g602k H1saRoF3FAOrfphCWuww0gnhXxUMdUuKlAEOy/9NoCvw7QwDHSSYeFGULz7cLiGgpZML m8Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=otf+Kn6E7gyvAshKC+Kdl4WFFbgC+FHpC4JGC79vfSY=; b=pf3msgCFZx+JGOj2LMwCYUL5HZH+ujugEqasxGXHGNSvtd6f2D6pNM6z0/3DXD/rM5 B3C9LOdUXd2hQG3c5y9mAuyyAEyYY4SxBFJHpIfngycykgt7DwXcVRvKsepPUkpRMgyu EuuV1CZrPdmzy99PTIvYskNKTAKYdszFXJQ1YY70PRQjOApj5R0ae5pp5E5H1lSiuk01 NA6qtFcuDviZ+277OXSIhUtxwIx7sJSmx4khqeDNoVeBvH0Iyy1lLe3yssX9tZwHETzB eQgoQhVWASmtzGECvGKjfEnOQ+gytsa0tHkMlrAXyxx22vXFbiRM7IPIrwCM9qgdAe7W H+cQ== X-Gm-Message-State: APjAAAVNecQBJ2BBD+Phqj6qJ3sMfI4ltl1+2OurWKHdHo10KFii2kZT cmj5B/I2vY6Ay9CFra2+VsE= X-Received: by 2002:a63:4641:: with SMTP id v1mr22592498pgk.389.1580188633925; Mon, 27 Jan 2020 21:17:13 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id d22sm17365348pfo.187.2020.01.27.21.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 21:17:13 -0800 (PST) Date: Tue, 28 Jan 2020 14:17:11 +0900 From: Sergey Senozhatsky To: Andy Shevchenko Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/5] console: Introduce ->exit() callback Message-ID: <20200128051711.GB115889@google.com> References: <20200127114719.69114-1-andriy.shevchenko@linux.intel.com> <20200127114719.69114-5-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127114719.69114-5-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/01/27 13:47), Andy Shevchenko wrote: [..] > +++ b/include/linux/console.h > @@ -148,6 +148,7 @@ struct console { > struct tty_driver *(*device)(struct console *, int *); > void (*unblank)(void); > int (*setup)(struct console *, char *); > + void (*exit)(struct console *); > int (*match)(struct console *, char *name, int idx, char *options); > short flags; > short index; > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index da6a9bdf76b6..6ca03d199132 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2853,6 +2853,10 @@ int unregister_console(struct console *console) > console->flags &= ~CON_ENABLED; > console_unlock(); > console_sysfs_notify(); > + > + if (console->exit) > + console->exit(console); > + If the console was not registered (hence not enabled) is it still required to call ->exit()? Is there a requirement that ->exit() should handle such cases? -ss