public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Pratap Nirujogi <pratap.nirujogi@amd.com>
To: <andi.shyti@kernel.org>, <rdunlap@infradead.org>,
	<hdegoede@redhat.com>, <ilpo.jarvinen@linux.intel.com>,
	<sfr@canb.auug.org.au>, <linux-next@vger.kernel.org>
Cc: <linux-i2c@vger.kernel.org>,
	<platform-driver-x86@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <benjamin.chan@amd.com>,
	<bin.du@amd.com>, <gjorgji.rosikopulos@amd.com>,
	<king.li@amd.com>, <dantony@amd.com>,
	"Pratap Nirujogi" <pratap.nirujogi@amd.com>
Subject: [PATCH v3 0/3] Fix build issue when CONFIG_MODULES is not set
Date: Fri, 6 Jun 2025 17:31:38 -0400	[thread overview]
Message-ID: <20250606213446.1145099-1-pratap.nirujogi@amd.com> (raw)

When CONFIG_MODULES is not defined, 'adap->owner->name' used in amd_isp4 platform
driver will not be valid and is resulting in build failures.

../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of undefined type 'struct module'
  154 |         return !strcmp(adap->owner->name, "i2c_designware_amdisp");
      |                                   ^~

To fix this issue, need to make changes both in platform and i2c driver modules.

* In the amd_isp4 x86/platform driver, replace 'adap->owner->name' with 'adap->name', this removes
the hard dependency on 'struct module'.
* In i2c amdisp driver, initialize unique name to i2c adapter and also make a change in
i2c-designware-common to avoid overwriting with generic name when adap->name[] is already set.

---

Changes v2 -> v3:

* Update commit text for patch 1/3


Changes v1 -> v2:

* Replace snprintf with scnprintf
* Add new isp4 specific misc header file to include the adapter name
* Remove 'Fixes' and 'Link' tags from i2c patches

---


Pratap Nirujogi (3):
  i2c: designware: Initialize adapter name only when not set
  i2c: amd-isp: Initialize unique adpater name
  platform/x86: Use i2c adapter name to fix build errors

 drivers/i2c/busses/i2c-designware-amdisp.c |  2 ++
 drivers/i2c/busses/i2c-designware-master.c |  5 +++--
 drivers/platform/x86/amd/amd_isp4.c        |  3 ++-
 include/linux/soc/amd/isp4_misc.h          | 12 ++++++++++++
 4 files changed, 19 insertions(+), 3 deletions(-)
 create mode 100644 include/linux/soc/amd/isp4_misc.h

-- 
2.43.0


             reply	other threads:[~2025-06-06 21:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 21:31 Pratap Nirujogi [this message]
2025-06-06 21:31 ` [PATCH v3 1/3] i2c: designware: Initialize adapter name only when not set Pratap Nirujogi
2025-06-06 21:31 ` [PATCH v3 2/3] i2c: amd-isp: Initialize unique adpater name Pratap Nirujogi
2025-06-09  8:36   ` Ilpo Järvinen
2025-06-09  9:38     ` Ilpo Järvinen
2025-06-09 15:24       ` Nirujogi, Pratap
2025-06-06 21:31 ` [PATCH v3 3/3] platform/x86: Use i2c adapter name to fix build errors Pratap Nirujogi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250606213446.1145099-1-pratap.nirujogi@amd.com \
    --to=pratap.nirujogi@amd.com \
    --cc=andi.shyti@kernel.org \
    --cc=benjamin.chan@amd.com \
    --cc=bin.du@amd.com \
    --cc=dantony@amd.com \
    --cc=gjorgji.rosikopulos@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=king.li@amd.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox