From mboxrd@z Thu Jan 1 00:00:00 1970 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 97E13C433F5 for ; Sun, 13 Mar 2022 11:01:34 +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:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:From:Date:Reply-To:To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C4KV8iimLflHklH6Lzlv8ht9nUMtsUqbsbmrAzlnf6I=; b=Xbt8MeVQ2sSkBi hiUTXpSQalSko1bDIck/DxRGwNtqw0hk93Hsxd/AD37tpIv5RHrrgeUUVc5iuN9EZ/cAsV6b0nM6V 8Ed8ePMgwilZ1DH8VwNdA4iaTRHYMfIxLt4WPtIBEkWoAnR6MInFcubrBvi6uxA08LDuqCzBqejV7 1zXFOawX/5qOXOqcdacGpwzKN7s34bd8HjJdWBc0WAmGUprW+0cQKOfkI5LpU4oLp/ez49gwbcQvj nT2mlQ49SMshldmeqxCFLYh5tGRgOmUO3N6yr3q5FfeOLQOv0iqtCaHdjjbjgqsCXQ8dOz12tczfK OENgtp5A3J0bQ4wJye6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLyZ-002dpr-8H; Sun, 13 Mar 2022 11:01:27 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLxQ-002dDU-KJ; Sun, 13 Mar 2022 11:00:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD0F1B80CA8; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220313_040017_051065_57D4EBFA X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauro Carvalho Chehab Date: Sun, 13 Mar 2022 12:00:02 +0100 Subject: [PATCH 00/24] Organize media platform drivers per manufacturer In-Reply-To: References: Message-ID: <20220313120002.0d782ce7@coco.lan> List-Id: To: linux-aspeed@lists.ozlabs.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D46FC4167B for ; Sun, 13 Mar 2022 11:00:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234660AbiCMLBZ (ORCPT ); Sun, 13 Mar 2022 07:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234654AbiCMLBX (ORCPT ); Sun, 13 Mar 2022 07:01:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BD3ED4464; Sun, 13 Mar 2022 04:00:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C328CB80CA9; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit From mboxrd@z Thu Jan 1 00:00:00 1970 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 C0C45C433EF for ; Sun, 13 Mar 2022 11:03:33 +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:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:From:Date:Reply-To:To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+3CYCFXutgeujp3tpjKsuFRFJt2xw7ZMUnLYYkSPA/o=; b=rIqH+B7SeZ08mT Z7Ut/zLIx7o10jR3kRNXtRkSqyr19C3eKaJGWqQBnSvmFREsjpAx5Rfu9cwMjXrsvlO4oS6JV8nMF tynr9YEKQrJbJK3+0kah2/4Q9sxYMBcyUL7gJMh+D5bC8C65StYXJre3aAY4NEdzlm0FtYQSmKS5E VbuhyJey5a8569e6vBGlWP095gOf5pc5/5l1YzAsrlF0SOm+KiZI7Cd2SnRRJH9/jHgnPT2j3/nId uscZwwe+4P/ec0zawghvnWFD2usOWrkngTJXHbj90JK4KHoepEH4MalDAxyWAkmgXkVj6Q96qd9ak So7x9y2hKREI7mJMF6Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTM0S-002eff-FA; Sun, 13 Mar 2022 11:03:24 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLxQ-002dDU-KJ; Sun, 13 Mar 2022 11:00:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD0F1B80CA8; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220313_040017_051065_57D4EBFA X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 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 B5EE6C433F5 for ; Sun, 13 Mar 2022 11:03:32 +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:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:From:Date:Reply-To:To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NaVv5cUmIqK7XGERNGd6/tQNALvmyEMA9WqfEtyM6vQ=; b=xDONj5zooFs2rx GpItJekAV1SfP/Ci8KczdDrPClr2C7/Q/YSSXD5YYDzVZe1+H0BpQs3z4kwYcHPNn0o06gkKJQ8P9 MJKGYVu1IVpdUsNq/f6m6rtF3bQDrZpR2XGMBk1Q2iinc6Ps76j8WNfbdqlTPgH7yESSYXW/JK1dC 01hjOkulZmr94hTaW+vkt0XUvkW47yGngXn6Ww5EP1cRR+u1m31vKWMd1cwB4KvXuXF/E4AIPKJP4 SLiVfyugGByxfnSq7yuIkUBJCXS9I47C3jm44F3A40yRmAGtmqBT6ktyx1HVx3Q0iAQJGa+Fscjwo NEVxI7uvhASApsfLxi/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTM0V-002egS-3M; Sun, 13 Mar 2022 11:03:27 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLxQ-002dDU-KJ; Sun, 13 Mar 2022 11:00:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD0F1B80CA8; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220313_040017_051065_57D4EBFA X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A533FA46 for ; Sun, 13 Mar 2022 11:00:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 51623C433EF for ; Mon, 14 Mar 2022 23:31:50 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KHXqn0JtCz30KP for ; Tue, 15 Mar 2022 10:31:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=f6FajvJW; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=mchehab@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=f6FajvJW; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KGcC53sbSz2x9S; Sun, 13 Mar 2022 22:00:17 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD0F1B80CA8; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 15 Mar 2022 10:24:35 +1100 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-aspeed@lists.ozlabs.org, Eddie James , Alexandre Torgue , Bjorn Andersson , linux-tegra@vger.kernel.org, "Lad, Prabhakar" , Andrzej Hajda , Fabio Estevam , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , linux-samsung-soc@vger.kernel.org, Kevin Hilman , openbmc@lists.ozlabs.org, linux-rockchip@lists.infradead.org, Andy Gross , NXP Linux Team , Mikhail Ulyanov , linux-sunxi@lists.linux.dev, linux-media@vger.kernel.org, Maxime Coquelin , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , linux-mediatek@lists.infradead.org, Jacek Anaszewski , Yong Deng , Matthias Brugger , linux-amlogic@lists.infradead.org, Sylwester Nawrocki , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Andrew Jeffery , Michael Tretter , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Philipp Zabel , Shawn Guo Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit From mboxrd@z Thu Jan 1 00:00:00 1970 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 D75F1C433F5 for ; Sun, 13 Mar 2022 11:03:38 +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:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:From:Date:Reply-To:To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RuNBR5kJneGAx9XifgNlivGpfxgHkBI1wlTbYMk59L8=; b=B8X1PLt9jp6FNu xiilvdyhqeS26+ayehj5N5sxk7ybfYBr+NMTDIHa7NiAGTivHuRPsu0cD4NgoDlNWqf26nPwRtPUH xgj2hZBFoRGhBSHEtJS9DzUiIcc6RFXsnNU7BKxGquhSa68+csw6Qz6MDrTNL1M13DgDNey7L6UcT 4bwYPdV0T2cuNTn1EftYqExfGMUO/adKi961AOEcnylN2LXIqKCPAN+dNCzW6jprYQAAiqANddLfY o81ubA2IBICSuC/DS3pjKvr9GU+++tw7xo2aEbPro7hLB5592tnV8thi05N7kif3ECgvLQKFh4sIE KO24+ef5lmHd9T6tDs9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLyu-002dto-Im; Sun, 13 Mar 2022 11:01:51 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTLxQ-002dDU-KJ; Sun, 13 Mar 2022 11:00:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD0F1B80CA8; Sun, 13 Mar 2022 11:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9060C340EC; Sun, 13 Mar 2022 11:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647169213; bh=K6raQ3hcVYXvtlWvYXOLgzshf6ywpYtouqfgtS4XSgI=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=f6FajvJWGzBUEAJpip4FTCW+ziT2N4Fes+bwxhm6P4X7wHhwUaOMcP7i6caQXwqAV SWFJaTRBzr7UeVqgZ+iQvK2L3/es8ZmF5h5H5xaq7iNbSQ7hOWUmfOoqgkr4yH0Kyi NtI8zelQGEh4QkIsNyt+pRe1NmA2S5GeVN6NyJtGOiToEcx9OvPpDe6BbFPYjsJ0TW Q2BxYhRUItV5G1A7lThY+qbpnEFFMkYGlshPOVw01Xmd9feBk2BRWRn4e0xWiwwXF3 /6jc7G1QK35edetsIKmeke+nHWz8o2iqh3gG38fXqgG+tLtV3iKAFRUZpClo/8XJVp Lk/RW6spFk5+g== Date: Sun, 13 Mar 2022 12:00:02 +0100 From: Mauro Carvalho Chehab Cc: "Lad, Prabhakar" , Alexandre Torgue , Andrew Jeffery , Andrzej Hajda , Andy Gross , Bjorn Andersson , Eddie James , Fabio Estevam , Heiko Stuebner , Jacek Anaszewski , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Tretter , Mikhail Ulyanov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Sylwester Nawrocki , Yong Deng , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH 00/24] Organize media platform drivers per manufacturer Message-ID: <20220313120002.0d782ce7@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220313_040017_051065_57D4EBFA X-CRM114-Status: GOOD ( 13.31 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Sun, 13 Mar 2022 11:51:41 +0100 Mauro Carvalho Chehab escreveu: > This series comes after the one I sent earlier today sorting media/platform Makefile and Kconfig. > > It basically groups all drivers per vendor, ensuring that each vendor has a Makefile/Kconfig > pair. > > The end goal is to keep the platform Makefile/Kconfig clean and easier to maintain, less > prune to errors. After applying both series, the size of such files were drastically reduced: > > drivers/media/platform/Kconfig | 731 ++------------------------------ > drivers/media/platform/Makefile | 115 +---- > 2 files changed, 78 insertions(+), 768 deletions(-) > > Mauro Carvalho Chehab (24): > media: platform: rename coda/ to chips-media/ > media: platform: rename marvell-ccic/ to marvell/ > media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ > media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ > media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ > media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ > media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ > media: platform: rename sunxi/ to allwinner/ > media: platform: rename tegra/vde/ to nvidia/tegra-vde/ > media: platform: rename amphion/ to nxp/amphion/ > media: platform: rename exynos4-is/ to samsung/exynos4-is/ > media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ > media: platform: rename s3c-camif/ to samsung/s3c-camif/ > media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ > media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ > media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ > media: platform: rename stm32/ to sti/stm32/ > media: platform: rename am437x/ to ti/am437x/ > media: platform: rename davinci/ to ti/davinci/ > media: platform: rename omap3isp/ to ti/omap3isp/ > media: platform: rename omap/ to ti/omap/ > media: platform: rename ti-vpe/ to ti/vpe/ > media: platform: Create vendor/{Makefile,Kconfig} files Worth mention that, while the above changes are really trivial, it is no fun to do them individually. It is also subject to errors. So, after manually doing a couple of them, I decided to revert to the original state and do it via the script below, checking the patches and editing the last one. Thanks, Mauro --- #!/bin/bash -e export LC_ALL=C # Needed by sort TMP=$(mktemp /tmp/rename.XXXXXXXXX) trap 'catch $LINENO' ERR SIGINT catch() { echo "Error on line $1" rm $TMP || true exit 1 } sort_makefile() { # sort Makefile sed '/^obj-y/Q' drivers/media/platform/Makefile> $TMP grep "^obj-y" drivers/media/platform/Makefile |sort | uniq >> $TMP cat <> $TMP # Please place here only ancillary drivers that aren't SoC-specific # Please keep it alphabetically sorted by Kconfig name # (e. g. LC_ALL=C sort Makefile) obj-\$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE) += m2m-deinterlace.o obj-\$(CONFIG_VIDEO_MUX) += video-mux.o EOF mv $TMP drivers/media/platform/Makefile } sort_kconfig() { # sort Kconfig sed '/^source/Q' drivers/media/platform/Kconfig> $TMP grep "^source" drivers/media/platform/Kconfig |sort | uniq >> $TMP cat <> $TMP endif # MEDIA_PLATFORM_DRIVERS EOF mv $TMP drivers/media/platform/Kconfig } do_rename_vendor() { old=$(echo $1 |perl -ne 's,/$,,; print $_') new=$(echo $2 |perl -ne 's,/$,,; print $_') echo "$old -> $new" mkdir -p dirname drivers/media/platform/$new git mv drivers/media/platform/$old/* drivers/media/platform/$new/ sed s,$old/,$new/, -i $(find drivers/media/platform/ -name Kconfig) $(find drivers/media/platform/ -name Makefile) sed s,drivers/media/platform/$old,drivers/media/platform/$new, -i $(git grep -l drivers/media/platform/$old) || true # Remove obj files, to make the directory cleaner rm -rf drivers/media/platform/$old/ || true sort_makefile sort_kconfig cat <> $TMP media: platform: rename $old/ to $new/ As the end goal is to have platform drivers split by vendor, rename $old/ to $new/. EOF git commit -as -m "$(cat $TMP)" --no-edit } do_rename_vendor coda chips-media do_rename_vendor marvell-ccic/ marvell/ do_rename_vendor meson/ge2d/ amlogic/meson-ge2d/ do_rename_vendor mtk-jpeg mediatek/mtk-jpeg do_rename_vendor mtk-mdp mediatek/mtk-mdp do_rename_vendor mtk-vcodec mediatek/mtk-vcodec do_rename_vendor mtk-vpu mediatek/mtk-vpu do_rename_vendor sunxi/ allwinner/ do_rename_vendor tegra/vde nvidia/tegra-vde do_rename_vendor amphion nxp/amphion do_rename_vendor exynos4-is/ samsung/exynos4-is/ do_rename_vendor exynos-gsc samsung/exynos-gsc do_rename_vendor s3c-camif samsung/s3c-camif do_rename_vendor s5p-g2d samsung/s5p-g2d do_rename_vendor s5p-jpeg samsung/s5p-jpeg do_rename_vendor s5p-mfc samsung/s5p-mfc do_rename_vendor stm32 sti/stm32 do_rename_vendor am437x/ ti/am437x/ do_rename_vendor davinci ti/davinci do_rename_vendor omap3isp ti/omap3isp do_rename_vendor omap ti/omap do_rename_vendor ti-vpe ti/vpe # Create or update drivers/media/platform/*/Kconfig IFS=$'\n' # Fixup Kconfig files for i in $(cat drivers/media/platform/Kconfig|perl -ne 'if (m,platform/([^/]+)/([^/]+)/Kconfig,) { print "$1 $2\n" }'); do echo "Handling $i Kconfig entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) kconfig="drivers/media/platform/$a/$b/Kconfig" parent="drivers/media/platform/$a/Kconfig" if [ ! -e $parent ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > $parent git add $parent fi echo "source \"$kconfig\"" >> drivers/media/platform/$a/Kconfig echo "source \"$parent\"" >> drivers/media/platform/Kconfig sed s,$kconfig,$parent, -i drivers/media/platform/Kconfig echo "sorting..." sort_kconfig done # Create or update drivers/media/platform/*/Makefile for i in $(cat drivers/media/platform/Makefile|perl -ne 'if (m,.*=\s*([^/]+)/([^/]+)/,) { print "$1 $2\n" }'); do echo "Handling $i Makefile entries" a=$(echo $i|cut -d' ' -f1) b=$(echo $i|cut -d' ' -f2) make="$a/$b/" parent="$a/" if [ ! -e drivers/media/platform/$a/Makefile ]; then echo "creating $parent..." echo "# SPDX-License-Identifier: GPL-2.0" > drivers/media/platform/$a/Makefile git add drivers/media/platform/$a/Makefile fi echo "obj-y += $b/" >> drivers/media/platform/$a/Makefile echo "obj-y += $parent" >> drivers/media/platform/Makefile sed s,$make\$,$parent, -i drivers/media/platform/Makefile done sort_kconfig sort_makefile cat <> $TMP media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. EOF git commit -as -m "$(cat $TMP)" --no-edit _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel