From patchwork Tue Oct 3 19:09:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9983409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFFE5602B8 for ; Tue, 3 Oct 2017 19:10:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B90D12889D for ; Tue, 3 Oct 2017 19:10:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADB2E28A1D; Tue, 3 Oct 2017 19:10:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63B672889D for ; Tue, 3 Oct 2017 19:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751111AbdJCTKC (ORCPT ); Tue, 3 Oct 2017 15:10:02 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34257 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbdJCTKC (ORCPT ); Tue, 3 Oct 2017 15:10:02 -0400 Received: by mail-pg0-f67.google.com with SMTP id u27so10671375pgn.1; Tue, 03 Oct 2017 12:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=d625+3sIHcBXLq6InsrHYeBcMpeEbVZssVgRLHr/vbA=; b=jIZ0uZO+IYbpyKR82aFh7NzbOrPyLMMkAt4X9jxlKRY0hWLOZFdabVGjv/3wuRdG8h i72Tb3Mt0aVYRQ0aPwsL2ngFasG8AgIjVhnBUrjkb30OCVK+tEkKH9g2lSZNYJ9yQxkb rob7nsKNV6DwKbzA8Wt+Ts9OGn4PFebp1iCWChzGXRNL6QlMNMVTEyudrcV8Lk3wqfnu Ec2dq6Lr1DmwhqKynVYKjQtUrABc9bj5xfxKEMnwh9bASUouUqdgODlO9l5vTGL+gNot Mpm/8ycIeFeLldbSHyDiN6DDG2cRbShDM2OGjNbFIZJkWytMhvNuTLqIDZXX2q/LK9k/ hfzQ== 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; bh=d625+3sIHcBXLq6InsrHYeBcMpeEbVZssVgRLHr/vbA=; b=IHGE4NPxPnQTGwwani0z+u7wvpins6Xtpwdath7GQxN/CXDmUoaXNREpHQD1bEQPjy JJVfYVyDwmOxvQNQgMkWq4IPywnblzg/ammi2DUt73Yy0xKuRuZep/C4rFBUJvrlyYpV YhwmWYyEDmzeTqNZ0xMdqkd7TEmE7XcWjZkhJVxTgVgg/l2oabW1Fd+HU6feCBejatUa o4nN7CL8sz0aevayiv9ICLAzCilqH0crtGwN2YyvadVFwJXJOlXHZ8Gdbb0z79ywjJYN t8VqJWsQeVCIxHGPHTfM5O7VwxCUV0+078FA/1iJgiQlcypuIHfdEMXXcDyIOmDOpZgy soYw== X-Gm-Message-State: AMCzsaWS4aIh3HqpuxAGHFZAfYbOqT5MmtH9PMpzhdVUbQ02gn+wMZ8a ljGIdkH5SQOWMBYXjHM2GIY= X-Google-Smtp-Source: AOwi7QA86knc5uVJhZpQpSqEubj5IP4PI+/uRcnzo+peDi1PzKgNrnX67qWGxSVjdL43D+Pfb9wnwQ== X-Received: by 10.159.246.12 with SMTP id b12mr1936022pls.58.1507057801485; Tue, 03 Oct 2017 12:10:01 -0700 (PDT) Received: from mappy.sklembedded.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.googlemail.com with ESMTPSA id r9sm2893084pfd.6.2017.10.03.12.09.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Oct 2017 12:10:00 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Russell King Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Steve Longerbeam Subject: [PATCH] media: staging/imx: do not return error in link_notify for unknown sources Date: Tue, 3 Oct 2017 12:09:13 -0700 Message-Id: <1507057753-31808-1-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP imx_media_link_notify() should not return error if the source subdevice is not recognized by imx-media, that isn't an error. If the subdev has controls they will be inherited starting from a known subdev. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-media-dev.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index b55e5eb..dd47861 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -508,8 +508,15 @@ static int imx_media_link_notify(struct media_link *link, u32 flags, imxmd = dev_get_drvdata(sd->v4l2_dev->dev); imxsd = imx_media_find_subdev_by_sd(imxmd, sd); - if (IS_ERR(imxsd)) - return PTR_ERR(imxsd); + if (IS_ERR(imxsd)) { + /* + * don't bother if the source subdev isn't known to + * imx-media. If the subdev has controls they will be + * inherited starting from a known subdev. + */ + return 0; + } + imxpad = &imxsd->pad[pad_idx]; /*