From patchwork Fri Feb 21 06:41:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shrirang Bagul X-Patchwork-Id: 1241914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48P21N2TxPz9sRk; Fri, 21 Feb 2020 17:41:43 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j520J-00051O-Hd; Fri, 21 Feb 2020 06:41:39 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j520I-00050E-4m for kernel-team@lists.ubuntu.com; Fri, 21 Feb 2020 06:41:38 +0000 Received: from 1.general.shrirang--bagul.uk.vpn ([10.172.198.4] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j520H-0001f4-9r for kernel-team@lists.ubuntu.com; Fri, 21 Feb 2020 06:41:37 +0000 From: Shrirang Bagul To: kernel-team@lists.ubuntu.com Subject: [SRU][B][PATCH 04/10] serdev: Make .remove in struct serdev_device_driver optional Date: Fri, 21 Feb 2020 14:41:21 +0800 Message-Id: <20200221064127.16848-5-shrirang.bagul@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200221064127.16848-1-shrirang.bagul@canonical.com> References: <20200221064127.16848-1-shrirang.bagul@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andrey Smirnov BugLink: https://bugs.launchpad.net/bugs/1864147 Using devres infrastructure it is possible to write a serdev driver that doesn't have any code that needs to be called as a part of .remove. Add code to make .remove optional. linux-oem buglink: http://bugs.launchpad.net/bugs/1769610 Acked-by: Philippe Ombredanne Acked-by: Pavel Machek Acked-by: Rob Herring Reviewed-by: Sebastian Reichel Reviewed-by: Guenter Roeck Signed-off-by: Andrey Smirnov Signed-off-by: Lee Jones (cherry picked from commit c5ff7de262b6e92ec88a20ea0a0244c29ccdc764) Signed-off-by: Shrirang Bagul Signed-off-by: AceLan Kao (cherry picked from commit 51fbf08701bc0ffdbf8ddb71adfdb0c0a0cb0b6f) (source tag: Ubuntu-oem-4.15.0-1073.83) Signed-off-by: Shrirang Bagul --- drivers/tty/serdev/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index e089a8dda467..fbf3abf74479 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -273,8 +273,8 @@ static int serdev_drv_probe(struct device *dev) static int serdev_drv_remove(struct device *dev) { const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver); - - sdrv->remove(to_serdev_device(dev)); + if (sdrv->remove) + sdrv->remove(to_serdev_device(dev)); return 0; }