Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3012376rdh; Mon, 27 Nov 2023 04:48:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFA4hhTmcMmS5VOsmKK6BY9D0pV5suCejEwVR4jdsvpZMSjN3uSIpG4QLpLo/uA3hjnHrzX X-Received: by 2002:a17:90b:1a91:b0:285:9804:5437 with SMTP id ng17-20020a17090b1a9100b0028598045437mr8953317pjb.26.1701089283289; Mon, 27 Nov 2023 04:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701089283; cv=none; d=google.com; s=arc-20160816; b=oxGZVt730CYdfnhisj/EhdX9cSUKfGDR7rc+hXGJ869M2VqU9Sfq8o/4O/cVEcnx2/ 6XFVkXSvK5OlxSobwcnw4UOI2whLaEX0zq9gskuMSr4wJkl8kg7imdWyDspvTUz+6fPO hdnOykcg3qtEtNkSo3i+9U/YGqS2b5tgTPDrpZh43AwpnxQfRYX9ggc1gGDIO2JyUGcy ceNgsQx+0p+cAnWzh79HTgXs+5IIlZDfT1FffFanweFAjxOxFPccYFw1XIDVyrWZVsXd JlgUfq2KS1ZXhi35KJeAs9gN8yTeU8eXqf5K/Z1uvqaq5E/SMDBhegAmPJbFuMq5p5Jd wVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F+E40YbuoBKmAjqkT6wNa06Lpu/e8RsvW8Aa+FgX6YU=; fh=GCPsaS9gPzUx9ecgCkAchNprj2XO1a7aLVETzufn50Y=; b=mEQaaSXYLZZM9RZQNWl8Tqkbo8AJEYkjmh4xV9dyULk63qzFiuR3b3FLT6KkVTNO4h Gvn26BXKM0jG2AHx/46tKKAMavArKN9N4YPh48l8vcj45r0WCdEfndoJKIxc6KiDbwlk pTw/SwVLYIDWz7jQhL2s0rfuCvDA/izEof8tPTFaCELzXMDyc3IWkdG7gVIhvuks8YkR XrKBYVJkQZwmEw25P324nvgiAAQ9533b13woz73X0DwX/j9Gkx0L4DVNtY0lJTF4yxmc b9UXYaEqR+/3ueaYEDk/q8Zl8lUs9kxQ5b8l9proM/TmX3JW0HecWqURH6TGhsJYCKTo 3/IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kv8XsuqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n8-20020a170902e54800b001cfa2728007si8194252plf.231.2023.11.27.04.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:48:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kv8XsuqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 46C878075013; Mon, 27 Nov 2023 04:47:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233544AbjK0MrL (ORCPT + 99 others); Mon, 27 Nov 2023 07:47:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbjK0Mqj (ORCPT ); Mon, 27 Nov 2023 07:46:39 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A36F183 for ; Mon, 27 Nov 2023 04:46:25 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-67a47104064so4146506d6.0 for ; Mon, 27 Nov 2023 04:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701089184; x=1701693984; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F+E40YbuoBKmAjqkT6wNa06Lpu/e8RsvW8Aa+FgX6YU=; b=Kv8XsuqFwPw+PendwGLsbOjgoUZwmmT3PNk1mxw2t3U3kn4cdhjOHOB3kVmNQwXRAk FwLl9+lrIHbOTprVKPx7LVmilDBdEK2cryucwPqkRQGBp7Lg95NKTJlpq+/WSAv06VnZ 4O0SK9Ve9coWk5MEVF2+fDbj3Oqi1buONg1E7Z8jg7AJ7WB5NTSHkoRUhC4CeB+Rlnfp OkNF0U8pLmkJqPOCRN0i7xURl6HMX3h6VAL8BM7k3bMwMj1Y1hO1Bn1wQNv7AjshEKdq 3ZciFLgMMhz9goS2FCBdIIWhw14c/Z1E9FscQE65HBNiJgEmyXlwNLNghmjQ2+63MhvB VYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701089184; x=1701693984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F+E40YbuoBKmAjqkT6wNa06Lpu/e8RsvW8Aa+FgX6YU=; b=N7Sg05hmMaV1RhreJULStwjmmuPMVMnQAJMHHO4ChGPMfBkBN1g1ScFmGzLRa9ktg4 +Dk+L1xs6VynYPFbh06e78v/kTEndtBGdcY5upctdWzkirQhnXVwXgk7grOUcbFcrFK7 /JZepxSaw4odSMup7Dn5ll0GfkWQPdHHDFCrPc9XdQpPumRIOqjLUFMVJ/Yrl7YUM3wD 9/nwV+7YW77pShFhleqW6UhqIU97pZwhz1rfbWjuL3zc+0XbsEs4s4gh92jU2iXZj7Z0 MDwrvhPOgXrPRStk6zpsGTXirg+aTOZ+WWj2OSdgC6fg2oghvENevMjh3zaaJ9GKjMo2 2RwA== X-Gm-Message-State: AOJu0Yz971G9PYWK6IoCVn4BOvdfhiTAUj2unZROU7DBX5MSj1Lbne7o cFQb+3oH3J8X3NraUYpyV4N+ X-Received: by 2002:a0c:edcd:0:b0:67a:49c5:8cc3 with SMTP id i13-20020a0cedcd000000b0067a49c58cc3mr1827133qvr.32.1701089184590; Mon, 27 Nov 2023 04:46:24 -0800 (PST) Received: from localhost.localdomain ([117.213.103.241]) by smtp.gmail.com with ESMTPSA id er10-20020a056214190a00b0067a204b4688sm2832231qvb.18.2023.11.27.04.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:46:24 -0800 (PST) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com Cc: kishon@kernel.org, bhelgaas@google.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 9/9] bus: mhi: ep: Add checks for read/write callbacks while registering controllers Date: Mon, 27 Nov 2023 18:15:29 +0530 Message-Id: <20231127124529.78203-10-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> References: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 27 Nov 2023 04:47:29 -0800 (PST) The MHI EP controller drivers has to support both sync and async read/write callbacks. Hence, add a check for it. Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/ep/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 3e599d9640f5..6b84aeeb247a 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -1471,6 +1471,10 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl, if (!mhi_cntrl || !mhi_cntrl->cntrl_dev || !mhi_cntrl->mmio || !mhi_cntrl->irq) return -EINVAL; + if (!mhi_cntrl->read_sync || !mhi_cntrl->write_sync || + !mhi_cntrl->read_async || !mhi_cntrl->write_async) + return -EINVAL; + ret = mhi_ep_chan_init(mhi_cntrl, config); if (ret) return ret; -- 2.25.1