From patchwork Thu Apr 11 21:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13626558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10EB4C4345F for ; Thu, 11 Apr 2024 21:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LKayrDQ+zv0Xbkqx4MySRHbPflAlM9Rz21UAiAyJ6lY=; b=l87Tg2vUxQ3zIq /HbdOyfojEbqZovKUvCMqYnGTKyrGb16ZfJStYnUsyQco8wddrPkY8A2xALb4fNaPdTNytkRRg9re ceBcFL7U19+iI1ZLJJEAIZwEH0aRlpCA6/o46MNYvAlvqEekTbKNbNfh6QtRebal4u4N4pjkwmC0i FuwE2UI/8PHIg1dMgS4SpAtEq/WKK8Ums6FNFJKP4/9Mt7lcupS8kzPgHfM6PPXvU9gMo0dOhctMH BqKm+hGOKFDZ3XCJKJd8We3SXE8Ug/n1q3JTFAMPD5Zb7ACFqiBL2/JwxbmHPou/0xhR1SevQR8ye GRFtIrLKGGiPJHQz1+xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv1o0-0000000E9i2-3EhR; Thu, 11 Apr 2024 21:18:00 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv1nv-0000000E9fF-0Zob for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2024 21:17:59 +0000 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-434a6024d0aso542381cf.0 for ; Thu, 11 Apr 2024 14:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712870274; x=1713475074; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KJkkcaX8CIYhd9XR8ScMRJRxMuN5zFK8kc96J/lpLIM=; b=KMkSkbbBxnTld7qeXBnuCaQfUPWz4IfJZBFOy0ztvKs1mCewel6ZpmgKU3BEPhArJX xU0ZvgP/P/u9tRRSQn6yf8x1VMwnU8zL97eSG7frndBTdKJX7lwWfoQP7TGwSEHIJFu5 hsBH2ulpM//Xaje+e/2NTup/hSZ+LMHD/wpL4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712870274; x=1713475074; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KJkkcaX8CIYhd9XR8ScMRJRxMuN5zFK8kc96J/lpLIM=; b=Kj+S2v07OK7YBas31K0FHplr06fbv19WX4K8e6eNCmF05Hlu2VR6hNDQ0Zxp0hYrzc FLB1YDGbcDXG+lTRPPC8pGzEoHQEbufmuKLIkP0puxkBtCdRTzUjFma73Qa4XNHvHMzt uBcmQIaMoqE4R3uF0rx5UF0o8jezrzXFIJlpaVMTXEdgGH2wjZ1qqolM1c6SB9goN4ss BMbY2jwOqbrDVintE4F1XH8Aw6yvDm8XrC1ms+97hlrz13O6EgBXMqBIB1VDMn76a9X2 0bD7OZG14sH+OeeoqS9F6787Bk4TI21DNBx99GkeDiUHrbE5/O90VC8GDbnimTw2T+/J o2dg== X-Forwarded-Encrypted: i=1; AJvYcCWFXqV2eNVhKNZmdSG+VD32GeyOSqD+w4fgxIN5ILgwJteAohDcth7A3erOxvhY2QuinXNKTsqdUg5EefHhfQohqB3eEE5Bo40/Ps0F88XMUL1C0g0= X-Gm-Message-State: AOJu0YziXf/TGWGtILyRTDpDAVaZ9w9nYmyESJXmrGsgtPFCQtzb63gg zhnV1++VdhblIc+Ycg69xzFlrBjPsPXIade4d6iiOZdMg6xz/+1lcKvnjZdiRA== X-Google-Smtp-Source: AGHT+IFTnqRZcteRINuntinTUGBmdgsxI+3hZuPuD7cseAqS47blu7YOY7bCkvUON9r8YSt9U/Nl/Q== X-Received: by 2002:a05:622a:107:b0:434:68f6:ae2a with SMTP id u7-20020a05622a010700b0043468f6ae2amr1066381qtw.16.1712870273700; Thu, 11 Apr 2024 14:17:53 -0700 (PDT) Received: from denia.c.googlers.com (200.234.86.34.bc.googleusercontent.com. [34.86.234.200]) by smtp.gmail.com with ESMTPSA id k20-20020ac84794000000b00434d7c4f9fasm1373362qtq.8.2024.04.11.14.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 14:17:52 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 11 Apr 2024 21:17:50 +0000 Subject: [PATCH 1/7] media: solo6x10: Use pcim functions MIME-Version: 1.0 Message-Id: <20240411-fix-smatch-v1-1-045f92467937@chromium.org> References: <20240411-fix-smatch-v1-0-045f92467937@chromium.org> In-Reply-To: <20240411-fix-smatch-v1-0-045f92467937@chromium.org> To: Bluecherry Maintainers , Anton Sviridenko , Andrey Utkin , Ismael Luceno , Mauro Carvalho Chehab , Patrice Chotard Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_141755_269336_1CD0DFDE X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of handling manually the release of the memory regions let devm do that for us. Makes smatch happy: drivers/media/pci/solo6x10/solo6x10-core.c:631 solo_pci_probe() warn: 'pdev' from pci_request_regions() not released on lines: 631. Signed-off-by: Ricardo Ribalda --- drivers/media/pci/solo6x10/solo6x10-core.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c index 6d87fbb0ee04a..abf30b7609e17 100644 --- a/drivers/media/pci/solo6x10/solo6x10-core.c +++ b/drivers/media/pci/solo6x10/solo6x10-core.c @@ -145,10 +145,8 @@ static void free_solo_dev(struct solo_dev *solo_dev) /* Now cleanup the PCI device */ solo_irq_off(solo_dev, ~0); free_irq(pdev->irq, solo_dev); - pci_iounmap(pdev, solo_dev->reg_base); } - pci_release_regions(pdev); pci_disable_device(pdev); v4l2_device_unregister(&solo_dev->v4l2_dev); pci_set_drvdata(pdev, NULL); @@ -480,15 +478,10 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) pci_write_config_byte(pdev, 0x40, 0x00); pci_write_config_byte(pdev, 0x41, 0x00); - ret = pci_request_regions(pdev, SOLO6X10_NAME); + ret = pcim_iomap_regions(pdev, BIT(0), SOLO6X10_NAME); if (ret) goto fail_probe; - - solo_dev->reg_base = pci_ioremap_bar(pdev, 0); - if (solo_dev->reg_base == NULL) { - ret = -ENOMEM; - goto fail_probe; - } + solo_dev->reg_base = pcim_iomap_table(pdev)[0]; chip_id = solo_reg_read(solo_dev, SOLO_CHIP_OPTION) & SOLO_CHIP_ID_MASK;