lora: shell: Remove use of DT_LABEL
Remove DT_LABEL usage that is needed for device_get_binding, replace this with DEVICE_DT_GET. Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
a8fbdf72f7
commit
7bb17e6fb7
1 changed files with 4 additions and 5 deletions
|
@ -15,7 +15,6 @@ LOG_MODULE_REGISTER(lora_shell, CONFIG_LORA_LOG_LEVEL);
|
||||||
#define DEFAULT_RADIO_NODE DT_ALIAS(lora0)
|
#define DEFAULT_RADIO_NODE DT_ALIAS(lora0)
|
||||||
BUILD_ASSERT(DT_NODE_HAS_STATUS(DEFAULT_RADIO_NODE, okay),
|
BUILD_ASSERT(DT_NODE_HAS_STATUS(DEFAULT_RADIO_NODE, okay),
|
||||||
"No default LoRa radio specified in DT");
|
"No default LoRa radio specified in DT");
|
||||||
#define DEFAULT_RADIO DT_LABEL(DEFAULT_RADIO_NODE)
|
|
||||||
|
|
||||||
static struct lora_modem_config modem_config = {
|
static struct lora_modem_config modem_config = {
|
||||||
.frequency = 0,
|
.frequency = 0,
|
||||||
|
@ -93,9 +92,10 @@ static const struct device *get_modem(const struct shell *shell)
|
||||||
{
|
{
|
||||||
const struct device *dev;
|
const struct device *dev;
|
||||||
|
|
||||||
dev = device_get_binding(DEFAULT_RADIO);
|
dev = DEVICE_DT_GET(DEFAULT_RADIO_NODE);
|
||||||
if (!dev) {
|
|
||||||
shell_error(shell, "%s Device not found", DEFAULT_RADIO);
|
if (!device_is_ready(dev)) {
|
||||||
|
shell_error(shell, "LORA Radio device not ready");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,6 @@ static const struct device *get_configured_modem(const struct shell *shell)
|
||||||
|
|
||||||
static int lora_conf_dump(const struct shell *shell)
|
static int lora_conf_dump(const struct shell *shell)
|
||||||
{
|
{
|
||||||
shell_print(shell, DEFAULT_RADIO ":");
|
|
||||||
shell_print(shell, " Frequency: %" PRIu32 " Hz",
|
shell_print(shell, " Frequency: %" PRIu32 " Hz",
|
||||||
modem_config.frequency);
|
modem_config.frequency);
|
||||||
shell_print(shell, " TX power: %" PRIi8 " dBm",
|
shell_print(shell, " TX power: %" PRIi8 " dBm",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue