Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3451316imu; Mon, 7 Jan 2019 03:42:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN6iAhZCub66LqJKRONXWoa+a/K/ZXVKhLn9Zhb+rPXwc1i7QIH2SatkFHOZLvUqIBT/xsii X-Received: by 2002:a65:6215:: with SMTP id d21mr10683716pgv.289.1546861349344; Mon, 07 Jan 2019 03:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546861349; cv=none; d=google.com; s=arc-20160816; b=rOGwGa10GotoS23q/5WeV2IMDrZYyR/zbkeGfYtolo0ZNF9FM4dGscqwuFgTFYSw6F lZndnE62fclyUHoiF3qsdpvzoZ+Ln7H2PIL/oVYNO93jh3V5cB8Px9YA0y4K1cE92MGv QbrUc44UU0p6FpMbWovgsO2Q4/BXscXP2UdFU9Y1yQtVS6QsrmJaQI+ClsY7WNb9uuIj hu2X3xO5XepMpvscFaUxSudMVUuuWalUGJLTDV0qYwkpGIjro7PFTSFZgWntNvxrCBOM 6PjEKNi+sCjNuvpzfIrbQWA68ANh+J6nlZywODXUMpUub1UGN3G6J+bEcJRACFKv8viL ByBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=ePJe8cVSRqtlaGA7V9EgMDTzK24IvCXYylFk83HfJes=; b=fCKxQ9ZkzUUZns97FBYlRzn66DNI72DnbxzTeM9/7P3Yv5YLjQDQk+eTloN6k/349e 8qFGLrC7LgSrw157bnDof3dOgOM+FnCZCG751Z7kCwtquw6NYMtxvh7muH3anqc5+hqP HoVvBmXV2kA4AtAP2lYatPkGHDipwSrC9rkZLn8DUjFT9uqJ99e2uQm4O22EawyU/CLQ w2E/3tcAacf60Iytbaoz+nPmvbWky4IjqboFmHWWj+0YbsTGBnh3J8rSYB3qRwLRcxR7 idf8wD/59LgvHVt1dEnkhcj0UTHgTRY1zNXdkxG2o67fEIXHEwpoLpPxCiChEtlCHoBL /vPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chromium.org header.s=google header.b=CdBHya0x; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si3671183pgj.315.2019.01.07.03.41.59; Mon, 07 Jan 2019 03:42:29 -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=fail header.i=@chromium.org header.s=google header.b=CdBHya0x; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbfAGLio (ORCPT + 99 others); Mon, 7 Jan 2019 06:38:44 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39156 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfAGLio (ORCPT ); Mon, 7 Jan 2019 06:38:44 -0500 Received: by mail-pl1-f196.google.com with SMTP id 101so24310pld.6 for ; Mon, 07 Jan 2019 03:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ePJe8cVSRqtlaGA7V9EgMDTzK24IvCXYylFk83HfJes=; b=CdBHya0xIV2o7rasb5t+gJ++qxMpDpd9XQOHA4HVSq2yhLq1m3OKjDgFWqproXlg2B 57Dozefo2H/3agSacTurbXzfemDjZSNVS27uIumyFWd/OSpyPcq/YLbutddlsan4dOgf A88dn/pmXnqA3BNlDUmkhps6E4PBlyiSLxS/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ePJe8cVSRqtlaGA7V9EgMDTzK24IvCXYylFk83HfJes=; b=BLGUz3fSgZEP7r2acq7ZlHz6xsHYcCx4CSJlzlvujale9BWPrGKb76C/UG084gps5H Lds8uaCBoV34ePxh27H30rRiJue5DAL2rRt/IGNtAHeWkEyDWBtgZydh6Yf+rIV+Pojv RqR9QfShqACJMoAQ6M5a0pIlxOmgT1uUflt2hfh0FcTPd839cpGpw1CmkFdScZe+zqDa mwZC4nMyBVtlJDkmUmMcG9jJCqgX6cPa05GFsWEj8IvWrA+MRhwEv54w2qjKv761oMEk M5d1Go3Tahxr7BZffCWLuGchjywhMaUblxnlEpJTnyGjMlBXuKLL5iiwu14ssCB+hU2O JBNA== X-Gm-Message-State: AJcUukcSyNheHCkotZ3hMVnHgEjPUnFKGgzJ+lYFpJUxD4wFpn0ebxZq VVmwk5spdaiBbDh2s1VVPEGDwA== X-Received: by 2002:a17:902:20b:: with SMTP id 11mr61093325plc.57.1546861123595; Mon, 07 Jan 2019 03:38:43 -0800 (PST) Received: from pihsun-z840.tpe.corp.google.com ([2401:fa00:1:10:7889:7a43:f899:134c]) by smtp.googlemail.com with ESMTPSA id m3sm109338783pff.173.2019.01.07.03.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 03:38:42 -0800 (PST) From: Pi-Hsun Shih Cc: Pi-Hsun Shih , Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org (open list:REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] rpmsg: core: Make remove handler for rpmsg driver optional. Date: Mon, 7 Jan 2019 19:38:32 +0800 Message-Id: <20190107113833.243672-1-pihsun@chromium.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most other bus (for example, SPI, i2c) have the remove handler for driver optional. Make remove handler for rpmsg driver optional too. Signed-off-by: Pi-Hsun Shih --- drivers/rpmsg/rpmsg_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 8122807db38094..ea88fd4e2a6ecf 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -493,7 +493,8 @@ static int rpmsg_dev_remove(struct device *dev) if (rpdev->ops->announce_destroy) err = rpdev->ops->announce_destroy(rpdev); - rpdrv->remove(rpdev); + if (rpdrv->remove) + rpdrv->remove(rpdev); dev_pm_domain_detach(dev, true); -- 2.20.1.97.g81188d93c3-goog