From patchwork Thu Apr 16 10:40:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11492705 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5278B1392 for ; Thu, 16 Apr 2020 10:45:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E27E21973 for ; Thu, 16 Apr 2020 10:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505326AbgDPKpI (ORCPT ); Thu, 16 Apr 2020 06:45:08 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:37541 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505337AbgDPKiY (ORCPT ); Thu, 16 Apr 2020 06:38:24 -0400 X-Originating-IP: 2.224.242.101 Received: from uno.homenet.telecomitalia.it (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id E7B9F60015; Thu, 16 Apr 2020 10:38:02 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, linux-renesas-soc@vger.kernel.org Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se, hyunk@xilinx.com, manivannan.sadhasivam@linaro.org Subject: [v8-rc1 04/20] squash! max9286: Update the bound_sources mask on unbind Date: Thu, 16 Apr 2020 12:40:36 +0200 Message-Id: <20200416104052.2643098-5-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200416104052.2643098-1-jacopo+renesas@jmondi.org> References: <20200416104052.2643098-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham The bound_sources bit mask tracks sources which have been successfully bound through the v4l2 async notifier system. Ensure that the mask is updated accordingly when unbinding. Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index cb58782e5143..b84d2daa6561 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -493,9 +493,12 @@ static void max9286_notify_unbind(struct v4l2_async_notifier *notifier, struct v4l2_subdev *subdev, struct v4l2_async_subdev *asd) { + struct max9286_priv *priv = sd_to_max9286(notifier->sd); struct max9286_source *source = asd_to_max9286_source(asd); + unsigned int index = to_index(priv, source); source->sd = NULL; + priv->bound_sources &= ~BIT(index); } static const struct v4l2_async_notifier_operations max9286_notify_ops = {